Skip to main content
Module

x/math/to_fixed.ts

Deno module for high-precision calculations and scientific computing
Latest
import * as math from "https://deno.land/x/math@v1.1.0/to_fixed.ts";

Functions

Returns a string representing the value of value in normal notation to a fixed number of dp decimal places. If the value of value in normal notation has more digits to the right of the decimal point than is specified by dp, the return value will be rounded to dp decimal places using rounding mode Big.RM. If the value of value in normal notation has fewer fraction digits then is specified by dp, the return value will be appended with zeros accordingly. Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation. Throws if value or dp is invalid.