JSPM

@writetome51/get-fixed-float

1.0.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 11
    • Score
      100M100P100Q25354F
    • License MIT

    Returns number with fixed number of digits after the decimal. It also rounds cautiously to avoid cumulative errors

    Package Exports

    • @writetome51/get-fixed-float

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@writetome51/get-fixed-float) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    getFixedFloat(number, numDigitsAfterDecimal): string

    Examples

    getFixedFloat(-100.9754, 5)); // --> -100.97540

    getFixedFloat(-1.9754, 1); // --> -2.0

    getFixedFloat(10.9754, 1); // --> 11.0

    getFixedFloat(101.965, 2); // --> 101.96

    getFixedFloat(101.975, 2); // --> 101.98