Basic.Scientific
Scientific notation formatting with configurable decimal places.
Syntax
DaxLib.FormatString.Basic.Scientific ( decimal_places )
Definition
DAX
// Format numbers in scientific notation
// Returns scientific notation like "1.23E+06", "4.56E-03"
(
// Number of decimal places (1-15)
decimal_places: INT64
) =>
VAR _Decimals = MAX( 1, MIN( decimal_places, 15 ) )
VAR _Notation = "0." & REPT( "0", _Decimals ) & "E+00"
VAR _Format =
DaxLib.FormatString.Component.MakeStringSafe (
FORMAT( SELECTEDMEASURE (), _Notation )
)
RETURN
_Format
Parameters
| Parameter | Type | Description |
|---|---|---|
decimal_places |
NUMBER | Number of decimal places in scientific notation |
Example
DaxLib.FormatString.Basic.Scientific ( 2 )
Use this function in a measure's formatStringDefinition to apply scientific notation formatting with 2 decimal places.
Related Functions
- Basic.Numbers - Basic number formatting
- Basic.SmarterRounding - Advanced number formatting