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

js-abbreviation-number

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-abbreviation-number - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

dist/index.js

@@ -5,3 +5,3 @@ "use strict";

padding: true,
symbols: ["", "K", "M", "G", "T", "P", "E"],
symbols: ["", "k", "M", "G", "T", "P", "E"],
};

@@ -8,0 +8,0 @@ function abbreviateNumber(num, digit, options) {

{
"name": "js-abbreviation-number",
"version": "1.2.0",
"version": "1.3.0",
"description": "Abbreviate numbers in javascript",

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

@@ -29,11 +29,11 @@ <div align="center">

const num = abbreviateNumber(1000, 1); // expected 1.0K
const num = abbreviateNumber(1000, 1); // expected 1.0k
const num = abbreviateNumber(12, 0); // expected 12
const num = abbreviateNumber(1100, 2); // expected 1.10K
const num = abbreviateNumber(1100, 2); // expected 1.10k
const num = abbreviateNumber(1100, 2, {padding: false}); // expected 1.1K
const num = abbreviateNumber(1100, 2, {padding: false}); // expected 1.1k
const num = abbreviateNumber(1234.56, 2); // expected 1.23K
const num = abbreviateNumber(1234.56, 2); // expected 1.23k

@@ -52,3 +52,3 @@ const num = abbreviateNumber(1234, 1, {symbols: ['', 'kg']}); // expected 1.2kg

- `symbols` can be an array of units, defaulting to `["", "K", "M", "G", "T", "P", "E"]`.
- `symbols` can be an array of units, defaulting to `["", "k", "M", "G", "T", "P", "E"]`.
- `padding` determines whether to keep the exact number of digits or to drop trailing zeroes.

@@ -55,0 +55,0 @@

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