Number.FromText

Updated on

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
Argument Attribute Description
text
culture optional The culture argument enables the specification of a Culture code (e.g., “nl-NL” or “en-US”) to align transformations with local formatting conventions. If this argument is omitted, functions default to Culture.Current, which reflects the system’s regional settings.

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 how text 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" )

Other functions related to Number.FromText are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/number-fromtext