Home  >  Article  >  What does Val in VB mean?

What does Val in VB mean?

angryTom
angryTomOriginal
2020-02-07 15:21:3629709browse

What does Val in VB mean?

What does Val in VB mean?

In the VB language, Val is a function that converts a numerical string into a numerical value.

val() function description: The

Val function stops reading the string at the first character it cannot recognize as a number.

Symbols and characters that are considered part of the numerical value, such as the US dollar sign and comma, are not recognized.

But the function can recognize the carry symbols &O (octal) and &H (hexadecimal). Whitespace, tabs, and newlines are stripped from parameters.

The following return value is 1615198:

Val("1615 198th Street N.E.")

In the following code, Val returns the decimal value -1 for the hexadecimal value shown.

Val("&HFFFF")

Note that the Val function only treats the period (.) as a usable decimal separator. When using a different decimal separator, such as in international versions of the application, CDbl is used instead to convert the string to a number.

For more VB tutorials, please visit PHP Chinese website.

The above is the detailed content of What does Val in VB mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn