Skip to content

toPlainDecimalString

toPlainDecimalString(value, fractionSeparator): string

Defined in: projects/ngx-signal-schema/src/lib/validators/decimal-parser.ts:18

Converts a number into a plain decimal string without scientific notation.

string | number

The numeric value to convert.

string

The decimal separator to use in the output string.

string

A plain string representation of the number.

toPlainDecimalString(12.34, "."); // returns "12.34"
toPlainDecimalString(1e-7, "."); // returns "0.0000001"
This makes it possible to count integer and fraction digits reliably.