mazey
    Preparing search index...

    Function floatToPercent

    • Convert a floating-point ratio to a percentage string.

      Usage:

      import { floatToPercent } from "mazey";

      const ret1 = floatToPercent(0.2);
      const ret2 = floatToPercent(0.2, 2);
      console.log(ret1);
      console.log(ret2);

      Output:

      20%
      20.00%
      

      Parameters

      • num: number

        Floating-point ratio to convert.

      • fixSize: number = 0

        Number of decimal places in the percentage.

      Returns string

      The percentage string.