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

bengali-number

v1.1.0

Published

An amazing package to convert your number to bengali word or number representation.

Downloads

37

Readme

bengali-number

An amazing package to convert your number to bengali word representation

Installation

Install via npm

$ npm i bengali-number

How to Use


const { toBengaliNumber, toBengaliWord} = require('bengali-number');

...
// Convert English number to it's bengali number representation

const bengaliNumberRepresentation = toBengaliNumber(9876543210.0123456789);
consle.log(bengaliNumberRepresentation) // output: ৯৮৭৬৫৪৩২১০.০১২৩৪৫৬৭৮৯

...

// Convert only numeric part of a text

const bengaliNumberWithText = toBengaliNumber('USD 999.123');
consle.log(bengaliNumberWithText) // output: USD ৯৯৯.১২৩

...

// Convert English number to it's Bengali word representation

const bengaliWordRepresentation = toBengaliWord(37762086.507);
console.log(bengaliWordRepresentation);  // output: তিন কোটি সাতাত্তর লক্ষ বাষট্টি হাজার ছিয়াশি দশমিক পাঁচ শুন্য সাত

Run Test:

To run tests after cloning or downloading this repository run following commands:

$ npm i
$ npm test

Then you will have these messages in terminal:

   Converts English number/digit to it's Bengali number representation
    ✓ should convert 'USD 987.123' to 'USD ৯৮৭.১২৩'
    ✓ should convert 1234567890 to ১২৩৪৫৬৭৮৯০
    ✓ should convert 9876543210.0123456789 to ৯৮৭৬৫৪৩২১০.০১২৩৪৫৬৭৮৯

  Convert Amount to Bengali Word Representation Test
    ✓ should convert 1 to bengali এক
    ✓ should convert 10000 to bengali দশ হাজার
    ✓ should convert 1277548.57 to it's bengali word represetation
    ✓ should convert 7576516080681.50 to it's bengali word represetation
    ✓ should convert 9999999999999 to it's bengali word represetation
    ✓ should convert 111111111110 to it's bengali word represetation
    ✓ should convert .5 to it's bengali word represetation
    ✓ should convert 111222333444555 to it's bengali word represetation
    ✓ should convert 200300400500.25 to it's bengali word represetation
    ✓ should convert 3.1416 to it's bengali word represetation
    ✓ should convert 100000000700.1234 to it's bengali word represetation

All the best, enjoy Javascript :smiley:

NB: For large numbers such as 3.7722526363525255e+27 it may provide unexpected result because of Javascript's long number limitation.

Developed with ♥ and respect to my mother language Bengali