Purpose
Removes formatting from a string that represents a number. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
DeformatNumber$ ( numeric_string )
numeric_string is a string that represents a numeric value, such as "12,345,678".
Return Value
String
Description
Returns a string that represents a number. The return value does not include thousands separators, regardless of whether the numeric_string argument included comma separators. The return value uses a period as the decimal separator, regardless of whether the user's computer is set up to use another character as the decimal separator.
Examples
The following example calls the Val() function to determine the numeric value of a string. Before calling the Val() function, this example calls the DeformatNumber$() function to remove comma separators from the string. (The string that you pass to the Val() function cannot contain comma separators.)
Dim s_number As String
Dim f_value As Float
s_number = "1,222,333.4"
s_number = DeformatNumber$(s_number)
' the variable s_number now contains the
' string: "1222333.4"
f_value = Val(s_number)
Print f_value
See Also:
FormatNumber$() function, Val() function