Skip to main content
Module

x/math/to_precision.ts

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

Functions

Returns a string representing the value of value to the specified number of sd significant digits. If the value of value has more digits than is specified by sd, the return value will be rounded to sd significant digits using rounding mode Big.RM. If the value of value has fewer digits than is specified by sd, the return value will be appended with zeros accordingly. If sd is less than the number of digits necessary to represent the integer part of the value in normal notation, exponential notation is used. If sd is omitted or is undefined, the return value is the same as .toString().