Convert string to number

Hello!

I have to convert string “0.003” to int/double 0.003. How can i do it? Convert function is rounding the result.

Thank you!

Hi @Andrei_Croitoru ,

Could you try the Below Expression :

CDbl("0.003")

HI @Andrei_Croitoru

Try with this
Cdbl(“0.003”)

Regards
Sudharsan

You can also use this expression @Andrei_Croitoru

Double.Parse(“0.003”)

Regards
Sudharsan

for integer same as double @Andrei_Croitoru

Cint(Value)
Integer.Parse(Value)

Where value should without decimal

Regards
Sudharsan

Have a summary on the 3 main approaches
grafik

 CDbl("0.003")
 0.003
 Convert.ToDouble("0.003")
 0.003
 Double.Parse("0.003")
 0.003

As an Integer cannot have fractions, so it will be less suitable for the parsing

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.