Number.ToText

Number

Converts a number to a text string, with optional format specifier and culture for locale-aware formatting.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.ToText(number as nullable number, optional format as nullable text, optional culture as nullable text) as nullable text

Parameters

NameTypeRequiredDescription
numbernumberYesThe number to convert to text.
formattextNoAn optional .NET format specifier such as "D" (decimal integer), "F2" (fixed 2 decimal places), "P" (percentage), "E" (scientific), "C" (currency), or "G" (general).
culturetextNoAn optional culture string (e.g., "en-US", "de-DE") that controls locale-specific formatting such as decimal and thousand separators.

Return Value

textA text representation of the number, formatted according to the optional format and culture.

Remarks

Number.ToText converts a number to a text string with optional format and culture control. When called with no format argument, it returns a compact general representation (similar to "G"). The format parameter follows .NET standard numeric format specifiers with an optional precision digit:

| Format | Name | Example | |--------|------|---------| | "G" | General | "3.14159" | | "F" / "F2" | Fixed-point | "3.14" | | "N" / "N2" | Number with thousands separators | "1,234.56" | | "P" / "P1" | Percentage | "87.5%" | | "E" / "E2" | Scientific notation | "3.14E+002" | | "C" / "C2" | Currency (symbol depends on culture) | "$3.14" | | "D" | Decimal integer (no fractions) | "42" |

The culture parameter controls locale-specific output: "de-DE" produces "1.234,56" for "N2" format, while "en-US" produces "1,234.56". Always specify the culture explicitly for user-facing output that must be locale-consistent.

Note that Number.ToText operates only on numbers. To convert other types to text, use Text.From.

Examples

Example 1: Format to 2 fixed decimal places

Number.ToText(3.14159, "F2")
Result
Result
13.14

Example 2: Format a ratio as a percentage with 1 decimal place

Number.ToText(0.8753, "P1")
Result
Result
187.5%

Example 3: Format unit prices with thousands separators and 2 decimal places

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Sales, 4), {"OrderID", "CustomerName", "UnitPrice"}),
    "DisplayPrice",
    each Number.ToText([UnitPrice], "N2", "en-US"),
    type text
)
Result
OrderID
CustomerName
UnitPrice
DisplayPrice
11Alice2525.00
22Bob5050.00
33Charlie1515.00
44Alice7575.00

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks