What is Val in VB? Val tutorial on how to use

Source: Internet
Author: User
Tags expression numeric numeric value

What is Val in VB? In the VB language, Val a function that converts a numeric string to a numeric value, stopping the reading of a string when it is not recognized as the first character of a number. Symbols and characters that are considered to be part of a value, such as the dollar number and the comma, cannot be identified. However, functions can recognize the rounding symbol &o (octal) and &h (hexadecimal). Whitespace, tabs, and line breaks are removed from the argument.

Val is a type conversion function:

VAL (string expression) converts a numeric string to a numeric value

Use method such as: VAL ("-3.85") return-3.85

VAL ("vb5.0") returns 0

VAL ("BC") returns 12

Val In contrast to the CStr function, CStr converts the value of a numeric expression to a string

CSTR (125) = "125"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.