Home > Common Problem > What does Val in VB mean?

What does Val in VB mean?

angryTom
Release: 2020-02-07 15:21:36
Original
29781 people have browsed it

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.")
Copy after login

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

Val("&HFFFF")
Copy after login

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!

Related labels:
vb
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template