JSPM

@toddself/round

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q25220F
  • License Apache-2.0

Round numbers

Package Exports

  • @toddself/round

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

Readme

Build Status

round

Round numbers to a specified number of signficant digits or return a 0

ES6 Module!

This is authored as an ES6 module and relies on ES6 features. The main key in package.json points to the transpiled ES5 source, but the jsnext:main key points to the ES6 original source. If your environement supports:

  • block scoping (let & const)
  • ES6 import and export

Then feel free to use the ES6 source directly.

Usage

import round from 'round'

console.log(round(12.5, 0)) // 13
console.log(round(14.5, 1)) // 14.5
console.log(round('robin')) // 0

License

Copyright 2015 Todd Kennedy, Apache 2.0