getDecimals

Commons
stable

Returns the number of decimal digits in a numeric value by inspecting its string representation. Used by Slider to infer step precision.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

value
required
number
The number to inspect. Its string form is trimmed before counting digits after the decimal point.

API

Return value

The value returned by this util.

The count of digits after the decimal separator (0 for integers).

Usage

Examples

Ready-to-paste usage snippets.

Count decimal places

typescript