Number.From
Number.From(value as any, optional culture as nullable text) as nullable number
Returns a number value from the given value. If the given value is null, Number.From returns null. If the given value is number, value is returned. Values of the following types can be converted to a number value:
text: Anumbervalue from textual representation. Common text formats are handled ("15", "3,423.10", "5.0E-10"). SeeNumber.FromTextfor details.logical: 1 fortrue, 0 forfalse.datetime: A double-precision floating-point number that contains an OLE Automation date equivalent.datetimezone: A double-precision floating-point number that contains an OLE Automation date equivalent of the local date and time ofvalue.date: A double-precision floating-point number that contains an OLE Automation date equivalent.time: Expressed in fractional days.duration: Expressed in whole and fractional days.
value is of any other type, an error is returned.Get the number value of "4".
Number.From("4")
4
Get the number value of #datetime(2020, 3, 20, 6, 0, 0).
Number.From(#datetime(2020, 3, 20, 6, 0, 0))
43910.25
Get the number value of "12.3%".
Number.From("12.3%")
0.123
Show: