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

approximate-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

approximate-number

Converts numbers into a more human-friendly format. For example, 123456 becomes '123k'.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-10.58%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Converts numbers into a more human-friendly format, similar to ls's --human-readable flag (ls -lh) or Stack Overflow's reputation numbers. For example, 123456 becomes '123k'. See tests for more examples.

Works in Node, browsers, and on the command line.,

Getting Started

Install node module with: npm install approximate-number

var approx = require('approximate-number');
approx(123456) // 123k

Or use the browser module with: bower install approximate-number

<script src="/bower_components/approximate-number/lib/approximate-number.js"></script>
<script>
alert(approximate(1234567890)); // 1.2b
</script>

Or install with -g for command line usage

$ npm install -g approximate-number
$ approximate-number 78910 #78k

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 Nathan Friedly
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 06 Nov 2014

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