New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

comma-it

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comma-it

Node.js module convert numbers to amounts

  • 0.0.5
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Comma-It.js

Build Status Tiny module to turn numbers into a more readble amounts by adding commas:

1234.5 => 1,234.50

commaIt( '12341233,12', {addPrecision:true}), '12 341 233,12'

Custom seperators:

commaIt('12341233.12', {addPrecision:true, thousandSeperator : ',', decimalSeperator : '.'}); // => 12,341,233.12'

At some point in time it's very easy to add support for multiple precisions and setup for precision and thousands seperator char, these are different in different parts of the world ofcourse.

@avnerner

Keywords

FAQs

Package last updated on 20 Nov 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc