npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

custom-numeral

v1.4.0

Published

A javascript library for formatting and manipulating numbers fully custmizable.

Downloads

12

Readme

Custom Numeral

A javascript library for formatting and manipulating numbers fully custmizable.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

Dependencies

  • A javascript library for formatting and manipulating numbers fully custmizable.
  • Support upto currencies [K, M, B, T] formatted.
  • Customizable with decimal digits.
  • Support the positive and negative values upto long numbers.
  • Simple solutions for long numbers in javascript.

Installing

npm i custom-numeral

Executing program

  • Import in files as usual packages like:
const customNumeral = require("custom-numeral")
  • How to handle big-numbers in javascript.
  • value take a big-number as string to handle. required
  • digits take a number that specifies digits after decimal. By default it will take 2 if not passed Optional

Without customNumeral the problem with big-numbers in javascript.

1000000049054700000000 as number

1.0000000490547e+21

After using customNumeral, it will handle the big-number and converted into currencies with comma saperated.

customNumeral({value: '1000000049054700000000'})

1,000,000,049.05T 

Handle the decimals values very well if values are so long.

customNumeral({value: '00.0000049054700000000'})

-74,378,149.05T 

Handle the negative values as well

customNumeral({value: '-743781490547'})

-743.78B 
customNumeral({value: '0.00124567'})

0.0012  

Handle the nagatives values with decimal.

customNumeral({value: '-049.054700000000'})

-49.05 

if we pass digits, then we can handle the digits after decimals like

customNumeral({value: '0.00124567', digits: 6})

0.001245  

Help

Any advise for common problems or issues.

Create an issue using click this link

Authors

Contributors names and contact info

@abhishekpatel946
Github

Features Version History

  • 1.4.x
    • Fixing the initial issues.
    • Implement features that are suggested by the community.
  • 1.3.0
    • Support the upto trillions in currencies.
    • Handle the postive and negative numbers very well.
    • Digits after decimal are customizable.

Publish

  • NOTE: Change the verison before publishing the package.
npm login
npm whoami
npm publish

License

This project is licensed under the [Apache License 2.0] License - see the LICENSE.md file for details.