Skip to content

decimalDigitAt

decimalDigitAt(value, position): number

Defined in: packages/math-numbers/src/decimal/decimal-digit-at.ts:17

The decimal digit at position, counting powers of ten — 0 is the units digit, 2 the hundreds, -1 the tenths.

0 for any position the value does not reach, which makes a numeral’s leading and trailing zeros indistinguishable from absent ones, as they are.

Readonly<Decimal>

The decimal to read.

number

The power of ten to read.

number

A digit from 0 to 9, ignoring the value’s sign.

If position is not an integer.