DeformatNumber$() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

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