decimalFixedPoint
Returns a factory that constructs DecimalFixedPoint values from decimal strings.
The outer call validates the shape parameters once and the returned factory can be called many times to construct values of that shape.
If the string carries more precision than the target decimals can
represent exactly, the returned factory throws
SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS under the
default 'strict' rounding mode. Pass a different RoundingMode
to allow a rounded result.
Type Parameters
| Type Parameter |
|---|
TSignedness extends Signedness |
TTotalBits extends number |
TDecimals extends number |
Parameters
| Parameter | Type |
|---|---|
signedness | TSignedness |
totalBits | TTotalBits |
decimals | TDecimals |
Returns
Parameters
| Parameter | Type |
|---|---|
input | string |
rounding? | RoundingMode |
Returns
DecimalFixedPoint<TSignedness, TTotalBits, TDecimals>