Returns a string representation of the BigFloat rounded to the specified
number of digits.
toPrecision(digits, roundingMode?, radix?)
digits
The number of digits.
roundingMode optional
A rounding mode as in BigFloatEnv. Defaults to BigFloatEnv.RNDNA (Round to nearest, with ties away from zero rounding mode).
radix optional
The radix of the result between 2 and 36. Defaults to 10.
A string representing the value. Can be in exponential notation.
123.4567l.toPrecision(1)
"1e+2"
123.4567l.toPrecision(4)
"123.5"
123.4567l.toPrecision(4, BigFloatEnv.RNDD)
"123.4"
123.4567l.toPrecision(4, BigFloatEnv.RNDD)
"123.4"
123.4567l.toPrecision(4, BigFloatEnv.RNDD, 16)
"7b.74"