Number

The Number function converts the input value into a number type.

The Number function can be used with other functions to convert the input value to a number before it is used.

Syntax

Number(input)

Function argument:

input
The text, date, logical, or number to convert to a number.

Notes

  • The function returns Null if conversion is not possible, such as if the input is not a valid number, or valid format of another accepted data type.
  • The function accepts arguments of the logical data type, where True is converted to 1 and False is converted to 0.
  • The function accepts arguments of the date data type, where the date is converted to the number of seconds since January 1st, 1970. For more information, see DateFromUnix.
  • Certain text values can be converted to numbers, such as exponential notation (e.g. 5.073456E10), but not other text formats like percentages, currency symbols, or hexadecimal values. See Examples for more information.

Examples

Number("15.25")
Number(15.25)

Both forms return 15.25.

Number("5.073456E10")
Number(5.073456E10)

Both forms return 50734560000, interpreting E as exponential notation.

Number(True)
Number(False)

Return 1 and 0 respectively.

Number("22253908723450973459872359073459073459073549734597")

Returns 2.2253908723450973e+49, compacting the number into exponential notation.

Number("953,486")

Returns Null, because the comma is not interpreted as a thousands separator.

Number("75%")

ReturnsNull, because the percent sign is not interpreted as a percentage.

Number("$75.347")

Returns Null

Number("#876")

Returns Null, because the character # is not interpreted as a hexadecimal indicator.

Number("N")

Returns Null, because the argument is not a number.

Number(2023-07-12 22:58:26)

Returns 1689202706 or the number of seconds between January 1st, 1970 and the date value.