decimalToPrecision
decimalToPrecision(
value,precision,roundingMode?):string
Defined in: packages/math-numbers/src/decimal/decimal-to-precision.ts:24
precision significant digits, in fixed-point notation unless the exponent
falls outside what fixed-point reads well — the same switch
Number.prototype.toPrecision makes, at an exponent below -6 or at or
above precision.
Unlike toPrecision there is no upper cap: an arbitrary-precision decimal
can hold more than 100 significant digits, so it can show them.
Parameters
Section titled “Parameters”Readonly<Decimal>
The decimal to render.
precision
Section titled “precision”number
Significant digits, at least one.
roundingMode?
Section titled “roundingMode?”RoundingMode = DEFAULT_ROUNDING_MODE
How to break the last digit. Defaults to half-even.
Returns
Section titled “Returns”string
The numeral.
Throws
Section titled “Throws”If precision is not an integer of at least one.