Convert to double 0.01-

Hello, I need to convert strings such as
0.01
6,758.89
0.01-
1,121,348.90-

to a double as:
0.01
6758.89
-0.01
-1121348.90

then after perform some calculation, I need to convert the doubles back to the same format string so I could use type into

what VB expressions I could use for each conversion?

thank you so much

Hi @lynnsong986 ,

Nice to connect with you again.

Could you pls try cdbl(your string) and store the value under double type. And also once you done with that change back to string using yourvalue.tostring. please try and let me know. Thanks.

@kirankumar.mahanthi1 thank you soooo much for your help again!! works perfectly!!

1 Like

Your most welcome @lynnsong986

to confirm already mentioned CDbl
grafik

Another option could be to work with Double.Parse e.g. for incorporating LocalSpecifics
grafik

For defensive checks, we can use Double.TryParse

1 Like

@ppr thank you Peter! Nice to know about double.parse and even nicer to know there is an immediate window in studio!

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