Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

comma-numbers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comma-numbers - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

index.js

@@ -17,5 +17,5 @@ module.exports = Comma;

characteristic = reverse(characteristic);
characteristic = characteristic.replace(/(\d{3})/g, '$1' + reverse(options.thousandSeparator));
characteristic = characteristic.replace(/(\d{3})(?!$)/g, '$1' + reverse(options.thousandSeparator));
characteristic = reverse(characteristic);
return hasMantissa ? characteristic + options.decimalSeparator + mantissa : characteristic;

@@ -22,0 +22,0 @@ }

{
"name": "comma-numbers",
"version": "0.0.1",
"version": "0.0.2",
"description": "format numbers with commas",

@@ -5,0 +5,0 @@ "main": "index.js",

var Comma = require('../');
var comma = Comma();
var assert = require('assert');
describe ('comma', function () {
var comma;
beforeEach(function () {
comma = Comma();
});
it ('should keep the given precision', function () {

@@ -32,2 +37,6 @@ assert.equal('1,200.42', comma(1200.42));

});
it ('should not comma 100s numbers', function () {
assert.equal('500', comma(500));
});
});
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