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

Abbreviate numbers in javascript

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by18.19%
Maintainers
1
Weekly downloads
 
Created
Source

js-abbreviation-number · Circle CI GitHub license PRs Welcome


Abbreviate numbers in javascript

Installation

npm install js-abbreviation-number

Usage


import { abbreviateNumber } from "js-abbreviation-number";

const num = abbreviateNumber(1000, 1); // expected 1.0K

const num = abbreviateNumber(12, 0); // expected 12

const num = abbreviateNumber(1111, 2); // expected 1.11K

const num = abbreviateNumber(1234.56, 1); // expected 1.2K

The symbols is optional. It can be an array of units, defaulting to ["", "K", "M", "G", "T", "P", "E"].

digit is also optional. It defaults to 1.

Contributing

Thank you for your interest in contributing! Please feel free to put up a PR for any issue or feature request.

Give me a Star

If you think this project is helpful just give me a ⭐️ Star is enough because i don't drink coffee 😃

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Author

Made with ❤️ by Mohsen Madani.

Keywords

FAQs

Package last updated on 03 Feb 2020

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