Package Exports
- percent-string
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 (percent-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
percent-string
create '%' appended strings for settings CSS properties
installation
npm:
$ npm install percent-string
component:
$ component install binocarlos/percent-string
usage
Use this module to convert numbers into percent strings
var percent = require('percent-string')
document.querySelector('#thing').style.left = percent(24)
document.querySelector('#thing').style.top = percent('24%')
api
var string = percent(value, max)
returns a string of the form: [num] + '%' regardless of the input type.
The zero value is '0%'
max indicates the scale so you can do 0.4 = 40%
var st = percent(.4, 1)
// st = '40%'
license
MIT