Single.From
NumberConverts a value to a single-precision floating-point number (32-bit IEEE 754).
Syntax
Single.From(value as any, optional culture as nullable text) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
value | any | Yes | The value to convert. Accepts number, text, logical, or null. |
culture | text | No | An optional culture string for locale-aware parsing of text values. |
Return Value
number — A single-precision (32-bit) floating-point number.
Remarks
Single.From converts a value to a single-precision (32-bit) IEEE 754 floating-point number. Single-precision provides only approximately 7 significant decimal digits of precision, compared to 15–17 for the default double-precision type. Values that exceed the single-precision range (~±3.4 × 10^38) overflow to positive or negative infinity.
This type is rarely used in typical Power Query data transformation. It exists primarily to interface with data sources or systems that explicitly use 32-bit floats — for example, certain scientific file formats, embedded systems data, or custom connector schemas that must match a 32-bit float column type. If you need to match a source column's REAL or FLOAT(4) SQL Server type precisely, Single.From provides that mapping.
A key practical concern is precision loss: converting a double value to single precision irreversibly truncates it to ~7 digits. For example, 1.23456789012345 becomes approximately 1.2345679. This loss cannot be recovered later. For most data modeling work, use the default number type (double-precision) or Decimal.From for financial values. Text values are parsed using the specified culture; logical true converts to 1.0, false to 0.0, and null returns null.
Examples
Example 1: Precision truncation when converting from double to single
Single.From(3.14159265358979)Result | |
|---|---|
| 1 | 3.14 |
Example 2: Convert text to single precision
Single.From("1.5")Result | |
|---|---|
| 1 | 1.50 |
Example 3: Demonstrate precision loss vs. double precision
let
Original = 1.23456789012345,
AsSingle = Single.From(Original),
AsDouble = Double.From(Original)
in
#table(
{"Type", "Value"},
{{"Single", AsSingle}, {"Double", AsDouble}}
)The final output — a table comparing the single-precision and double-precision representations side by side.
Type | Value | |
|---|---|---|
| 1 | Single | 1.23 |
| 2 | Double | 1.23 |