bangla-money-format
v1.2.5
Published
đ§đŠ Complete Bengali/Bangla money & number formatting library for JavaScript. Convert numbers to Bengali text (ā§ā§ĢâāĻĒāĻāĻāĻžāϤā§āϤāϰ āĻāĻžāĻāĻž), format Bangladesh Taka currency with proper comma placement (ā§§ā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļâā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ). Perfect for React, Vue, Angular, Node.js a
Downloads
43
Maintainers
Keywords
Readme
Bangla Money Format
A comprehensive Bengali/Bangla money and number formatting library with accurate compound numbers, traditional scales, English conversion, and modern short forms. Perfect for financial applications, e-commerce platforms, banking systems, and any application requiring Bengali number formatting.
Features
- đĸ Accurate Bengali Number Formatting: Convert numbers to Bengali text with proper compound number grammar
- đ° Money Formatting: Format currency with Bengali digits and text
- đī¸ Traditional Scale Support: Enhanced traditional Bengali number scales with proper terms
- đ English Conversion: Convert Bengali text to English equivalents
- ⥠Short Forms: Modern K, M, B, T notation support
- đ Dual Language: Support for both Bengali and English output
- đĄ Highly Configurable: Extensive options for customization
- đ Large Numbers: Support for numbers up to 10^20
- â Linguistically Accurate: Proper Bengali compound numbers with correct traditional forms
- đ¯ ES6 & CommonJS: Both import and require supported
Installation
npm install bangla-money-formatyarn add bangla-money-formatpnpm add bangla-money-formatQuick Start
Using CommonJS (require)
const { toText, toBanglaMoney } = require("bangla-money-format");
// Basic usage
console.log(toText(1000000));
// Output: āĻĻāĻļ āϞāĻžāĻ āĻāĻžāĻāĻž
console.log(toBanglaMoney(1000000));
// Output: ā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
console.log(toText(1500, { useShortForm: true }));
// 1.5K āĻāĻžāĻāĻž
console.log(toText(1500.75));
// āĻāĻ āĻšāĻžāĻāĻžāϰ āĻĒāĻžāĻāĻ āĻļāϤ āĻāĻžāĻāĻž āϏāϤā§āϤāϰ āĻĒāĻžāĻāĻ āĻĒāϝāĻŧāϏāĻž
console.log(toText(1500.75, { textInEnglish: true }));
// one thousand five hundred taka seventy five paisaUsing ES6 Modules (import)
import { toText, toBanglaMoney } from "bangla-money-format";
// Basic usage
console.log(toText(1000000));
// Output: āĻĻāĻļ āϞāĻžāĻ āĻāĻžāĻāĻž
console.log(toBanglaMoney(1000000));
// Output: ā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
console.log(toText(1500, { useShortForm: true }));
// 1.5K āĻāĻžāĻāĻž
console.log(toText(1500.75));
// āĻāĻ āĻšāĻžāĻāĻžāϰ āĻĒāĻžāĻāĻ āĻļāϤ āĻāĻžāĻāĻž āϏāϤā§āϤāϰ āĻĒāĻžāĻāĻ āĻĒāϝāĻŧāϏāĻž
console.log(toText(1500.75, { textInEnglish: true }));
// one thousand five hundred taka seventy five paisaExamples
// Bengali compound numbers (accurate)
console.log(toText(75));
// Output: āĻĒāĻāĻāĻžāϤā§āϤāϰ āĻāĻžāĻāĻž
console.log(toText(555));
// Output: āĻĒāĻžāĻāĻ āĻļāϤ āĻĒāĻā§āĻāĻžāύā§āύ āĻāĻžāĻāĻž
// English output
console.log(toText(1000000, { textInEnglish: true }));
// Output: ten lakh taka
// Short form
console.log(toText(1500000, { useShortForm: true }));
// Output: 1.5M āĻāĻžāĻāĻž
// Traditional scale
console.log(toText(1000000000, { useTraditionalScale: true }));
// Output: āĻāĻāĻļāϤ āĻā§āĻāĻŋ āĻāĻžāĻāĻžUse Cases
Financial Applications
- Banking Software: Account statements, transaction records
- Invoice Generation: Professional invoices with Bengali amounts
- Accounting Systems: Financial reports and calculations
- Payroll Management: Salary slips and payment processing
E-commerce & Retail
- Online Shopping: Product pricing in Bengali
- Point of Sale (POS): Receipt generation
- Inventory Management: Stock valuation
- Price Display: Multi-language price formatting
Government & Education
- Tax Calculation: Income tax and VAT calculations
- Educational Software: Mathematics and finance teaching
- Government Forms: Official document generation
- Census Data: Population and economic statistics
Regional Applications
- Bangladesh: BDT currency formatting
- West Bengal: INR with Bengali text
- Bengali Communities: Worldwide Bengali diaspora applications
API Reference
toText(number, options)
Converts a number to Bengali text representation with money formatting.
Parameters
number(Number): The number to convertoptions(Object): Configuration options
Options
| Option | Type | Default | Description |
| ----------------------- | ------- | ---------- | --------------------------------------- |
| showCurrency | Boolean | true | Show currency symbol (ā§ŗ) |
| currency | String | "ā§ŗ" | Currency symbol to use |
| showTakaWord | Boolean | true | Include "āĻāĻžāĻāĻž" in the text |
| useTraditionalScale | Boolean | false | Use traditional Bengali scales |
| textInEnglish | Boolean | false | Convert Bengali text to English |
| useShortForm | Boolean | false | Use K, M, B, T notation |
| showEnglishEquivalent | Boolean | false | Show English equivalents in parentheses |
| showFraction | Boolean | true | Include fraction part |
| fractionPrecision | Number | 2 | Decimal places for fractions |
| fractionUnit | String | "āĻĒāϝāĻŧāϏāĻž" | Unit for fraction part |
| negativeFormat | String | "minus" | How to display negative numbers |
| template | String | "{text}" | Output template for toText function |
toBanglaMoney(number, options)
Formats a number as Bengali currency without text conversion.
Parameters
number(Number): The number to format as currencyoptions(Object): Configuration options (same as toText)
toBanglaMoney Examples
const { toBanglaMoney } = require("bangla-money-format");
// Basic usage - only currency formatting
console.log(toBanglaMoney(1000));
// ā§ŗā§§,ā§Ļā§Ļā§Ļ
console.log(toBanglaMoney(50000));
// ā§ŗā§Ģā§Ļ,ā§Ļā§Ļā§Ļ
console.log(toBanglaMoney(1000000));
// ā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
console.log(toBanglaMoney(25000000));
// ⧺⧍,ā§Ģā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
// Large numbers
console.log(toBanglaMoney(1000000000));
// ā§ŗā§§,ā§Ļā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
// Decimal numbers
console.log(toBanglaMoney(1500.75));
// ā§ŗā§§,ā§Ģā§Ļā§Ļ
// Negative numbers
console.log(toBanglaMoney(-5000));
// -ā§ŗā§Ģ,ā§Ļā§Ļā§Ļ
// Custom currency symbol
console.log(toBanglaMoney(1000, { currency: "BDT" }));
// BDTā§§,ā§Ļā§Ļā§Ļ
// No currency symbol
console.log(toBanglaMoney(1000, { showCurrency: false }));
// ā§§,ā§Ļā§Ļā§Ļ
// Different negative format
console.log(toBanglaMoney(-1000, { negativeFormat: "parenthesis" }));
// (ā§ŗā§§,ā§Ļā§Ļā§Ļ)Usage Examples
Basic Number Formatting
const { toText } = require("bangla-money-format");
// Compound numbers (accurate Bengali)
console.log(toText(75));
// āĻĒāĻāĻāĻžāϤā§āϤāϰ āĻāĻžāĻāĻž
console.log(toText(55));
// āĻĒāĻā§āĻāĻžāύā§āύ āĻāĻžāĻāĻž
console.log(toText(99));
// āύāĻŋāϰāĻžāύāĻŦā§āĻŦāĻ āĻāĻžāĻāĻž
// Small numbers
console.log(toText(1500));
// āĻāĻ āĻšāĻžāĻāĻžāϰ āĻĒāĻžāĻāĻ āĻļāϤ āĻāĻžāĻāĻž
// Large numbers
console.log(toText(1000000));
// āĻĻāĻļ āϞāĻžāĻ āĻāĻžāĻāĻž
console.log(toText(10000000));
// āĻāĻ āĻā§āĻāĻŋ āĻāĻžāĻāĻžTraditional vs Modern Scale
// Modern scale (default)
console.log(toText(1000000000));
// āĻāĻ āĻļāϤ āĻā§āĻāĻŋ āĻāĻžāĻāĻž
// Traditional scale with improved terms
console.log(toText(1000000000, { useTraditionalScale: true }));
// āĻāĻāĻļāϤ āĻā§āĻāĻŋ āĻāĻžāĻāĻž
console.log(toText(1000000000000, { useTraditionalScale: true }));
// āĻāĻ āϞāĻā§āώ āĻā§āĻāĻŋ āĻāĻžāĻāĻž
// With English equivalents
console.log(
toText(1000000000000, {
useTraditionalScale: true,
showEnglishEquivalent: true,
})
);
// āĻāĻ āϞāĻā§āώ āĻā§āĻāĻŋ (āĻāĻ āĻā§āϰāĻŋāϞāĻŋāϝāĻŧāύ) āĻāĻžāĻāĻžImproved Traditional Scale System
Version 1.2.0 introduces enhanced traditional Bengali scale terms:
| Scale | Value | Traditional Term | English Equivalent | | ------ | ----- | ---------------- | ------------------ | | āĻ āϰā§āĻŦā§āĻĻ | 10âš | āĻāĻāĻļāϤ āĻā§āĻāĻŋ | One Billion | | āĻāϰā§āĻŦ | 10šⰠ| āĻāĻ āĻšāĻžāĻāĻžāϰ āĻā§āĻāĻŋ | Ten Billion | | āύāĻŋāϞ | 10šš | āĻĻāĻļ āĻšāĻžāĻāĻžāϰ āĻā§āĻāĻŋ | Hundred Billion | | āĻĒāĻĻā§āĻŽ | 10š² | āĻāĻ āϞāĻā§āώ āĻā§āĻāĻŋ | One Trillion | | āĻļāĻā§āĻ | 10ÂšÂŗ | āĻĻāĻļ āϞāĻā§āώ āĻā§āĻāĻŋ | Ten Trillion |
Bengali to English Conversion
// Convert Bengali text to English
console.log(
toText(75000000000, {
useTraditionalScale: true,
textInEnglish: true,
})
);
// ā§ŗā§ā§Ģ,ā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļ (seventy five ten billion taka)
// ā§ŗā§§,ā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļā§Ļ (āĻāĻ āĻ
āϰā§āĻŦā§āĻĻ āĻāĻžāĻāĻž)English Text Conversion
// Bengali text (default)
console.log(toText(125000));
// āĻāĻ āϞāĻžāĻ āĻŦāĻŋāĻļ āĻĒāĻžāĻāĻ āĻšāĻžāĻāĻžāϰ āĻāĻžāĻāĻž
// English text
console.log(toText(125000, { textInEnglish: true }));
// one lakh twenty five thousand taka
// Traditional with English equivalents
console.log(
toText(1000000000, {
useTraditionalScale: true,
showEnglishEquivalent: true,
})
);
// āĻāĻ āĻ
āϰā§āĻŦā§āĻĻ (āĻāĻ āĻŦāĻŋāϞāĻŋāϝāĻŧāύ) āĻāĻžāĻāĻžShort Form Notation
// Bengali short form
console.log(toText(1500, { useShortForm: true }));
// 1.5K āĻāĻžāĻāĻž
console.log(toText(1500000, { useShortForm: true }));
// 1.5M āĻāĻžāĻāĻž
console.log(toText(1500000000, { useShortForm: true }));
// 1.5B āĻāĻžāĻāĻž
// English short form
console.log(toText(1500000, { useShortForm: true, textInEnglish: true }));
// 1.5M takaNegative Numbers
console.log(toText(-5000, { negativeFormat: "word" }));
// āĻāĻŖ āĻĒāĻžāĻāĻ āĻšāĻžāĻāĻžāϰ āĻāĻžāĻāĻž
console.log(
toText(-5000, {
negativeFormat: "word",
textInEnglish: true,
})
);
// negative five thousand takaFractions
console.log(toText(1500.75));
// āĻāĻ āĻšāĻžāĻāĻžāϰ āĻĒāĻžāĻāĻ āĻļāϤ āĻāĻžāĻāĻž āϏāϤā§āϤāϰ āĻĒāĻžāĻāĻ āĻĒāϝāĻŧāϏāĻž
console.log(toText(1500.75, { textInEnglish: true }));
// one thousand five hundred taka seventy five paisaCustom Templates
// Text only
console.log(toText(1000000, { template: "{text}" }));
// āĻĻāĻļ āϞāĻžāĻ āĻāĻžāĻāĻž
// Amount only with toBanglaMoney
console.log(toBanglaMoney(1000000));
// ā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ
// Custom format using template
console.log(
toText(1000000, {
template: "Amount: {currency}{amount} | Text: {text}",
})
);
// Amount: ā§ŗā§§ā§Ļ,ā§Ļā§Ļ,ā§Ļā§Ļā§Ļ | Text: āĻĻāĻļ āϞāĻžāĻ āĻāĻžāĻāĻžTraditional Bengali Number System
This library supports the traditional Bengali number system with proper scales:
| Scale | Bengali | English Equivalent | Value | | ------ | ------- | ------------------ | ----- | | āĻšāĻžāĻāĻžāϰ | āĻšāĻžāĻāĻžāϰ | Thousand | 10Âŗ | | āϞāĻžāĻ | āϞāĻžāĻ | Lakh | 10âĩ | | āĻā§āĻāĻŋ | āĻā§āĻāĻŋ | Crore | 10⡠| | āĻ āϰā§āĻŦā§āĻĻ | āĻ āϰā§āĻŦā§āĻĻ | Billion | 10âš | | āĻāϰā§āĻŦ | āĻāϰā§āĻŦ | Ten Billion | 10šⰠ| | āύāĻŋāϞ | āύāĻŋāϞ | Hundred Billion | 10šš | | āĻĒāĻĻā§āĻŽ | āĻĒāĻĻā§āĻŽ | Trillion | 10š² | | āĻļāĻā§āĻ | āĻļāĻā§āĻ | Ten Trillion | 10ÂšÂŗ |
Short Form Reference
| Number | Bengali Short | English Short | | ----------------- | ------------- | ------------- | | 1,500 | 1.5K | 1.5K | | 15,000 | 15K | 15K | | 1,500,000 | 1.5M | 1.5M | | 15,000,000 | 1.5Cr | 15M | | 1,500,000,000 | 1.5B | 1.5B | | 1,500,000,000,000 | 1.5T | 1.5T |
Advanced Configuration
const customOptions = {
showCurrency: true,
currency: "ā§ŗ",
showTakaWord: true,
useTraditionalScale: false,
textInEnglish: false,
useShortForm: false,
showEnglishEquivalent: false,
showFraction: true,
fractionPrecision: 2,
fractionUnit: "āĻĒāϝāĻŧāϏāĻž",
negativeFormat: "minus", // "minus", "word", "parenthesis"
template: "{currency}{amount} ({text})",
};
console.log(toText(1234567.89, customOptions));Compatibility
- â Node.js: 12.0.0+
- â Browser: All modern browsers
- â React: Full support
- â Vue.js: Full support
- â Angular: Full support
- â TypeScript: Type definitions included
- â ES6/CommonJS: Both module systems supported
Regional Support
- đ§đŠ Bangladesh: BDT (ā§ŗ) currency formatting
- đŽđŗ West Bengal, India: INR (âš) with Bengali text
- đ Global Bengali Communities: Worldwide diaspora support
Performance
- ⥠Fast: Optimized for speed
- đ Lightweight: Minimal dependencies
- đž Memory Efficient: Low memory footprint
- đ§Ž Accurate: Precise BigInt calculations
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Issues
If you find any issues or have feature requests, please create an issue on GitHub.
Keywords
Bengali/Bangla: āĻŦāĻžāĻāϞāĻž āĻāĻžāĻāĻž āĻĢāϰāĻŽā§āϝāĻžāĻ, āĻŦāĻžāĻāϞāĻž āϏāĻāĻā§āϝāĻž āϰā§āĻĒāĻžāύā§āϤāϰ, āĻŦāĻžāĻāϞāĻžāĻĻā§āĻļā§ āĻāĻžāĻāĻž, āĻŦāĻžāĻāϞāĻž āĻ āĻā§āĻ, āĻā§āĻāĻŋ āϞāĻžāĻ āĻšāĻžāĻāĻžāϰ, āĻ āϰā§āĻŦā§āĻĻ āĻāϰā§āĻŦ āύāĻŋāϞ āĻĒāĻĻā§āĻŽ
English: bangla money format, bengali number converter, bangladesh taka formatter, bengali currency, bengali digits, crore lakh thousand, bengali math, number to bengali text, bangla calculator, bengali financial, south asian currency, bengali localization
Applications: invoice generator bengali, bengali accounting software, bangladesh banking, bengali ecommerce, bengali fintech, bengali payment gateway, bengali pos system, bengali receipt generator
Technical: nodejs bengali, javascript bengali, bengali npm package, bengali api, bengali sdk, bengali library, bengali utility, bengali formatting
Made with â¤ī¸ for the Bengali community
