integralFractionalFromString
integralFractionalFromString(
text):IntegralFractional
Defined in: packages/math-numbers/src/integral-fractional.ts:55
Parses a decimal numeral into its IntegralFractional decomposition.
Accepts an optional sign, an optional exponent, and a point on either side of
the digits (.5 and 5. both parse). The exponent is applied by moving the
point, so 1e-7 yields seven decimal places rather than none — a plain
string scan of the printed form would miss that.
Trailing zeros are preserved: "1.50" gives fracDigits: 2, so a numeral’s
own precision survives the round trip through
integralFractionalToString.
Parameters
Section titled “Parameters”string
The numeral to read. Surrounding whitespace is ignored.
Returns
Section titled “Returns”The decomposition.
Throws
Section titled “Throws”If text is not a decimal numeral. NaN and ±∞ are
not, having no decomposition.