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

bd_number

v3.0.2

Published

This package is for bangla number conversion

Downloads

9

Readme

"bd_number"

"bd_number": An Open Source JavaScript Library for Bangla Number Conversion and Phone Number Validator.

In today's world, it's important for websites and applications to be accessible and usable by a global audience. This includes not only the language used in the text, but also the format of numbers and dates. To address this need, an open source JavaScript library, "bd_number," has been developed specifically for converting numbers to Bangla text.

"bd_number" is a small, lightweight library that makes it easy for developers to convert Bangla Number to English Number,English Number to Bangla Number ,English Number to Bangla Word, English Number To BDT Word in English and Bangladeshi Phone Number Validator representation. It is completely open source and can be used in any web project without any restrictions.

Install

$ npm install --save bd_number

Usage | English To Bangla Word

const { enToBnWord } = require("bd_number");
let word = enToBnWord(12433334);
console.log(word); // এক কোটি চব্বিশ লাখ তেত্রিশ হাজার তিনশ চৌত্রিশ

Usage | Bangla To English Number

const { bnToEnNum } = require("bd_number");
let en = bnToEnNum("৮২৬");
console.log(en); // 826

Usage | English To Bangla Number

const { enToBnNum } = require("bd_number");
let bn = enToBnNum("826");
console.log(bn); // ৮২৬

Usage | Bangladeshi Phone Number Validator

const { isValidPhone } = require("bd_number");
// OR
const { isValidPhone } = require("bd_number/lib/phone");

let isOkThisNumber = isValidPhone("01739000000");
console.log(isOkThisNumber); // true

getNumInfo | If phone number is valid

const { getNumInfo } = require("bd_number");
// OR
const { getNumInfo } = require("bd_number/lib/phone");

let numberInfo = getNumInfo("01739000000");
console.log(numberInfo);

// Output | If [isValidPhone: true]
{
  inputLength: 11,
  isValidPhone: true,
  hasOperator: true,
  operatorStatus: '(017) Valid Operator',
  withCountryCode: '+8801739000000',
  status: '+8801739000000'
}

getNumInfo | If phone number is invalid

const { getNumInfo } = require("bd_number");
// OR
const { getNumInfo } = require("bd_number/lib/phone");

let numberInfo = getNumInfo("0173900000000");
console.log(numberInfo);

// Output | If [isValidPhone: false]
{
  inputLength: 13,
  isValidPhone: false,
  hasOperator: true,
  operatorStatus: '(017) Valid Operator',
  withCountryCode: '+8801739000000',
  status: '+8801739000000',
  exceed: 2,
  hasExceed: true,
  originalNumber: '+880173900000000',
  exceedDigit: '00',
  errorStatus: 'Exceed 2 Digit'
}

Usage | English Number To BDT Word in English

const { numToBDTWord } = require("bd_number");
// OR
const { numToBDTWord } = require("bd_number/lib/numToWord");

let finalAmount = numToBDTWord(128357.66);
console.log(finalAmount);
// Output : One Lakh Twenty Eight Thousand Three Hundred And Fifty Seven Taka And Sixty Six Paisa