Number.FromText is a Power Query M function that creates a number value from a given text representation, with support for common text formats and an optional culture parameter. The function returns the created number value.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Number.FromText(
text as nullable text,
optional culture as nullable text,
) as nullable number
Description
Returns a number
value from the given text value, text
.
text
: The textual representation of a number value. The representation must be in a common number format, such as “15”, “3,423.10”, or “5.0E-10”.culture
: An optional culture that controls howtext
is interpreted (for example, “en-US”).
Examples
Get the number value of "4"
.
// Output: 4
Number.FromText( "4" )
Get the number value of "5.0e-10"
.
// Output: 5E-10
Number.FromText( "5.0e-10" )
Related functions
Other functions related to Number.FromText are:
- Byte.From
- Currency.From
- Decimal.From
- Double.From
- Int16.From
- Int32.From
- Int64.From
- Int8.From
- Number.From
- Number.ToText
- Percentage.From
- Single.From
