Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to Convert Characters into Decimals in VB
How to Convert Characters into Decimals in VB
The data type of String in VB is string, and the data types of decimal are Float (single precision floating-point decimal) and Double (double precision floating-point decimal).

The Val(S) function is used to convert a string variable composed of numbers into a number variable, where s stands for a string composed entirely of numbers. For example, the string a="39.3245 ". To convert this character into decimal, just use b=Val(a).

The Round(M, n) function needs to keep the specified number of decimal places. M stands for decimal places, and n stands for reserved decimal places. The function of this function is to round m and keep n decimal places. For example, M=39.32455, then Round(M, 4)=39.3246.