binaryFixedPoint
Returns a factory that constructs BinaryFixedPoint 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.
The input string is parsed as a decimal number and scaled by
2 ** fractionalBits to compute the raw bigint. Values that cannot be
represented exactly in binary (such as "0.1") trigger the rounding
behaviour documented on RoundingMode, with 'strict' throwing
SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS by default.
Type Parameters
| Type Parameter |
|---|
TSignedness extends Signedness |
TTotalBits extends number |
TFractionalBits extends number |
Parameters
| Parameter | Type |
|---|---|
signedness | TSignedness |
totalBits | TTotalBits |
fractionalBits | TFractionalBits |
Returns
Parameters
| Parameter | Type |
|---|---|
input | string |
rounding? | RoundingMode |
Returns
BinaryFixedPoint<TSignedness, TTotalBits, TFractionalBits>