Return a number as string with , or K. A simple and small integration
MIT License
Bot releases are visible (Hide)
https://github.com/mesqueeb/commafy-anything/compare/v3.0.4...v4.0.0
https://github.com/mesqueeb/commafy-anything/compare/v3.0.3...v3.0.4
https://github.com/mesqueeb/commafy-anything/compare/v3.0.2...v3.0.3
https://github.com/mesqueeb/commafy-anything/compare/v3.0.1...v3.0.2
https://github.com/mesqueeb/commafy-anything/compare/v3.0.0...v3.0.1
Published by mesqueeb over 2 years ago
esm
package with "type": "module"
in package.jsonhttps://github.com/mesqueeb/commafy-anything/compare/v2.0.0...v2.1.1
Published by mesqueeb almost 4 years ago
Now there are only named exports:
// before
import commafy from 'commafy-anything'
// after
import { commafy } from 'commafy-anything'
thousands comma is shown by default.
// before
t.is(commafy(1000), '1000')
t.is(commafy(10000), '10,000')
// now
t.is(commafy(1000), '1,000')
t.is(commafy(10000), '10,000')
updated the options object & better typescript support:
// options as second param:
{ stripDecimals?: boolean, spacedDecimals?: boolean, thousandsComma?: boolean }
// of which defaults are
{ stripDecimals: false, spacedDecimals: false, thousandsComma: true }