Format a number with a fixed number of decimal places.
Usage:
import { floatFixed } from "mazey";const ret1 = floatFixed(0.2);const ret2 = floatFixed(0.2, 2);console.log(ret1);console.log(ret2); Copy
import { floatFixed } from "mazey";const ret1 = floatFixed(0.2);const ret2 = floatFixed(0.2, 2);console.log(ret1);console.log(ret2);
Output:
0 0.20 Copy
0 0.20
Number or numeric string to format.
Number of decimal places.
The fixed-point string.
Format a number with a fixed number of decimal places.
Usage:
Output: