Skip to main content

Module number

Module number 

Source
Expand description

javascript number formatting (Number.prototype.toString()), used wherever the typescript code converts a number to a string ("" + n, template literals).

Functionsยง

js_number_to_string
String(n): shortest round-trip representation, javascript exponent rules
js_parse_number
Number(str) / unary +str for css numeric strings
js_round
Math.round(): half up (towards +inf), -0 for the values in [-0.5, 0)
js_to_precision
+value.toPrecision(precision): the exact decimal value rounded half up to precision significant digits, parsed
num_to_str
String(n) for an integer or a float
to_fixed
n.toFixed(digits)