String to Number

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hi guys,

How can I convert this:
0.87 as a text to:
0.87 as a number?

What is the function that allows me to convert it?
Thank you in advance.

P.S. I did my homework, but I could not find or make
anything. Your help will be appreciated.
 
Try CSng function (to make it a Single format) or CDbl function (to make it
a Double format).

NumberValue = CSng("0.87")


You also can use the Val function to convert the first numbers in a text
string (up to the first nonnumeric character) into a number value:

Val("0.87") yields 0.87.

Val("0.875A12") yields 0.875.
 
Thank you, Ken.

-----Original Message-----
Try CSng function (to make it a Single format) or CDbl function (to make it
a Double format).

NumberValue = CSng("0.87")


You also can use the Val function to convert the first numbers in a text
string (up to the first nonnumeric character) into a number value:

Val("0.87") yields 0.87.

Val("0.875A12") yields 0.875.


--
Ken Snell
<MS ACCESS MVP>




.
 
Back
Top