commafy-anything

Return a number as string with , or K. A simple and small integration

MIT License

Downloads
2.6K
Stars
2

Bot releases are visible (Hide)

commafy-anything - Latest Release

Published by mesqueeb 5 months ago

  • feat: esm only! node v18+ ๐ŸŽ‰ e073c2d

https://github.com/mesqueeb/commafy-anything/compare/v3.0.4...v4.0.0

commafy-anything -

Published by mesqueeb over 1 year ago

commafy-anything -

Published by mesqueeb over 1 year ago

  • fix: exports order 8fcfb73
  • chore: update dependencies be9ed5a
  • chore: maintenance 45d912b
  • update readme 9880712
  • improve readme a4c64d0

https://github.com/mesqueeb/commafy-anything/compare/v3.0.2...v3.0.3

commafy-anything -

Published by mesqueeb over 2 years ago

commafy-anything -

Published by mesqueeb over 2 years ago

commafy-anything - v3.0.0

Published by mesqueeb over 2 years ago

breaking changes

  • requires node v12+
  • is now an esm package with "type": "module" in package.json
commafy-anything -

Published by mesqueeb over 2 years ago

  • update scripts c6b6127
  • Remove ignored files 75c05d8
  • chore: build ec682b1
  • chore: build be7ac19
  • chore: build 705e4ca
  • chore: build 6aa2542
  • build: cleanup ๐Ÿงผ 56e480d
  • add funding ๐Ÿ’œ 72da33d
  • update readme ๐Ÿ›ต 6d209ba
  • build: rename "typings" โ†’ "types" 557a2de
  • Merge branch 'production' of https://github.com/mesqueeb/commafy-anything into production 89e5c2c
  • build: add release script 3bcbe55
  • Update README.md af331a0
  • Update README.md fe28ba7
  • Update README.md 4ba51d5
  • feat: add K option 329305e

https://github.com/mesqueeb/commafy-anything/compare/v2.0.0...v2.1.1

commafy-anything - Only named exports & thousands comma by default

Published by mesqueeb almost 4 years ago

Breaking changes

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 }