Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Overview

Number to Bangla Number, Word or Month Name in Laravel

Packagist GitHub stars GitHub forks GitHub issues GitHub license MadeWithLaravel.com shield | Get Wordpress Plugin

Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format for Laravel 5.5+. Maximum possible number to covert in Bangla word is 999999999999999 Example,

Operation English Input Bangla Output
Text (Integer) 13459 তেরো হাজার চার শত ঊনষাট
Text (Float) 1345.05 এক হাজার তিন শত পঁয়তাল্লিশ দশমিক শূন্য পাঁচ
Number 1345.5 ১৩৪৫.৫
Text Money Format 1345.50 এক হাজার তিন শত পঁয়তাল্লিশ টাকা পঞ্চাশ পয়সা
Month 12 ডিসেম্বর
Comma (Lakh) 121212121 ১২,১২,১২,১২১

Installation

Install the package through Composer. On the command line:

composer require rakibhstu/number-to-bangla

Configuration

If Laravel > 7, no need to add provider

Add the following to your providers array in config/app.php:

'providers' => [
    // ...

    Rakibhstu\Banglanumber\NumberToBanglaServiceProvider::class,
],

Usage

Here you can see some example of just how simple this package is to use.

use Rakibhstu\Banglanumber\NumberToBangla;

$numto = new NumberToBangla();

// If you want to convert any number (Integer of Float) into Bangla Word
$text = $numto->bnWord(13459);    // Output:  তেরো হাজার চার শত ঊনষাট
$text = $numto->bnWord(1345.05);  // Output:  এক হাজার তিন শত পঁয়তাল্লিশ দশমিক শূন্য পাঁচ

Number to Bangla Word

Use bnWord() to convert any number into bangla word. Example,

// Integer
$text = $numto->bnWord(13459);    // Output:  তেরো হাজার চার শত ঊনষাট

// Float
$text = $numto->bnWord(1345.05);    // Output: এক হাজার তিন শত পঁয়তাল্লিশ দশমিক শূন্য পাঁচ
$text = $numto->bnWord(345675.105); // Output: তিন লক্ষ পঁয়তাল্লিশ হাজার ছয় শত পঁচাত্তর দশমিক এক শূন্য পাঁচ

Number to Bangla Money Format

Use bnMoney() to convert any number into bangla money format with 'টাকা' & 'পয়সা'. Example,

$text = $numto->bnMoney(13459);     // Output:  তেরো হাজার চার শত ঊনষাট টাকা
$text = $numto->bnMoney(13459.05);  // Output:  তেরো হাজার চার শত ঊনষাট টাকা পাঁচ পয়সা
$text = $numto->bnMoney(13459.5);   // Output:  তেরো হাজার চার শত ঊনষাট টাকা পঞ্চাশ পয়সা

Number to Bangla Number

Use bnNum() to convert any number into bangla number. Example,

$text = $numto->bnNum(13459);    // Output:  ১৩৪৫৯
$text = $numto->bnNum(2334.768); // Output:  ২৩৩৪.৭৬৮

Number to Month Name in Bangla

Use bnMonth() to convert any number into bangla number. Input Limit (1-12) Example,

$text = $numto->bnMonth(1);    // Output:  জানুয়ারি 
$text = $numto->bnMonth(4);    // Output:  এপ্রিল

Comma separated number

Use bnCommaLakh() to convert any number into bangla number. Example,

$text = $numto->bnCommaLakh(12121212);    // Output:  ১,২১,২১,২১২

License

Number to Bangla is licensed under The MIT License (MIT).

You might also like...
Laminas\Text is a component to work on text strings

laminas-text This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Zend\Text is a component to work on text strings from Zend Framework

zend-text Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-text. Zend\Text is a component to work on text strings. It cont

Simple PHP package for add two numbers

Sum Simple PHP package for add two numbers Installation To get the latest version of Sum, simply require the project using Composer: composer require

> Create e-wallet, send money, withdraw and check balance all via USSD protocol
Create e-wallet, send money, withdraw and check balance all via USSD protocol

Mobile Money USSD solution Create e-wallet, send money, withdraw and check balance all via USSD protocol Create e-wallet Step 1 Step 2 Step 3 Step 4 S

A money and currency library for PHP

Brick\Money A money and currency library for PHP. Introduction Working with financial data is a serious matter, and small rounding mistakes in an appl

A pool for players to mine money

MoneyPool v1.0.2 A pool for players to mine money

A plugin for working with popular money libraries in Pest

This package is a plugin for Pest PHP. It allows you to write tests against monetary values provided by either brick/money or moneyphp/money using the same declarative syntax you're used to with Pest's expectation syntax.

The stock market inflation adjusted for the US-money supply

Inflation Chart Inflation Chart is a project to find the intrinsic value of stock markets, stock prices, goods and services by adjusting them to the a

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

Comments
  • Please modify

    Please modify

    121| $n = preg_replace("/(\d+?)(?=(\d\d)+(\d)(?!\d))(.\d+)?/i", "$1,", $num); 122| return strtr($n,$this->numbers)

    Please modify this line ending with semicolon (;)

    opened by himelali 1
Releases(v1.4.0)
Owner
Md. Rakibul Islam
Laravel, Vue.js developer and OSS maintainer. Love to trek and play cricket.
Md. Rakibul Islam
CPAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your PHP project.

CPAY CHOCO PAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your P

faso-dev 1 Oct 26, 2022
A PHP component to convert HTML into a plain text format

html2text html2text is a very simple script that uses DOM methods to convert HTML into a format similar to what would be rendered by a browser - perfe

Jevon Wright 423 Dec 29, 2022
CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

Sajjad 2 Aug 14, 2022
Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost,metronet in Laravel framework

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel. You should use

Ariful Islam 95 Jan 3, 2023
A PHP library to convert text to speech using various services

speaker A PHP library to convert text to speech using various services

Craig Duncan 98 Nov 27, 2022
Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.

Quiritibus Plugin This repository is storing the custom plugin developed for the Quiritibus Latin Magazine website, currently being developed at: http

Alkor András 1 Jan 19, 2022
A simple package for working with money.

Money A simple package for working with money. Main features: Simple API Livewire integration Custom currency support Highly customizable formatting R

ARCHTECH 143 Nov 18, 2022