mazey
    Preparing search index...

    Function floatFixed

    • 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);

      Output:

      0
      0.20
      

      Parameters

      • num: string | number

        Number or numeric string to format.

      • size: number = 0

        Number of decimal places.

      Returns string

      The fixed-point string.