decimal-to-percent

1.0.1 • Public • Published

decimal-to-percent Build Status

Convert a decimal proportion to a percentage string

Converts any valid decimal value to a percentage string with no rounding or range limitations.

Install

$ npm install --save decimal-to-percent

Usage

var toPercent = require('decimal-to-percent')
 
toPercent(0.1)
//=> 10%
 
toPercent(-0.1)
//=> -10%
 
toPercent(0.001)
//=> 0.1%

API

toPercent(decimal) -> string

decimal

Required
Type: number

Any valid number between -Infinity and Infinity, exclusive.

License

MIT © Ben Drucker

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    22
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    22
  • 1.0.0
    0

Package Sidebar

Install

npm i decimal-to-percent

Weekly Downloads

22

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker