JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 645
  • Score
    100M100P100Q95351F
  • License ISC

Package Exports

  • round-to-precision

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 (round-to-precision) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

round-to-precision

Round a number to a specific precision. Useful in user interfaces.

Install

$ npm install --save round-to-precision

Usage

var roundToPrecision = require('round-to-precision');

roundToPrecision(10)(52.65);
//=> 50

roundToPrecision(0.25)(-0.7);
//=> -0.75

roundToPrecision(0.1)(0.36);
//=> 0.4

Numbers are rounded to a specific precision.

API

roundToPrecision(precision)

Returns a roundToSpecificPrecision function.

roundToSpecificPrecision(value)

Round a value to specific precision.

value

Type: number

precision

Type: number (positive).

License

MIT © Dmitriy Semyushkin