Android Question who currency to normal

puang

Member
100000 to $ 100.000
the code :
Value = 100000
Value = Table2.GetValue(col, row) 'gets the cell value and transforms it into a String
sValue = "$ " & NumberFormat2(Value, 1, 0, 0, True) 'formats the value into a string
sValue = sValue.Replace(",", ".") 'replaces the commas by dots.
Next

i want the opposite
$ 100.000 to 100000
the code:
??? help
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use B4XFormatter to format the number as string.

About the opposite direction, assuming that it is not coming from a user input then you shouldn't do anything with the formatted string. Work with the original numbers instead. This way you will not suffer from rounding issues.

You can of course parse this string easily with:
B4X:
Dim n As Int = s.Replace("$", "").Replace(".", "")
 
Upvote 0

puang

Member
You should use B4XFormatter to format the number as string.

About the opposite direction, assuming that it is not coming from a user input then you shouldn't do anything with the formatted string. Work with the original numbers instead. This way you will not suffer from rounding issues.

You can of course parse this string easily with:
B4X:
Dim n As Int = s.Replace("$", "").Replace(".", "")
# Erel Thanks...
 
Upvote 0
Top