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...
Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey

TYPO3 Phone Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey. Installation composer require si

This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.

Laravel Nova Search This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets. Requirements laravel-mix v6.0+ php 7.3+

Make Laravel Pivot Tables using the new Laravel 9 closure migration format

This will allow you to create pivot table migration files using the new Laravel 9 closure migration format by simply passing two models.

Iconify icon sets in JSON format

100+ open source icon sets. Icons are validated, cleaned up, optimised, ready to render as SVG

Convert remote api response data into laravel model
Convert remote api response data into laravel model

laravel remote model Create remote driver to convert remote api request into laravel model. 中文文档 日本語文書 overview Install the version between laravel5.5

Simplest Slugify for PHP to convert string into a slug.
Simplest Slugify for PHP to convert string into a slug.

Simplest Slugify for PHP to convert string into a slug. Documentation You can find the detailed documentation here in Slugify Documentation. Contribut

Tool to convert from composer.yml to composer.json.

composer-yaml This project allows you to convert a composer.yml file into composer.json format. It will use those exact filenames of your current work

🔌  Convert Bootstrap CSS code to Tailwind CSS code
🔌 Convert Bootstrap CSS code to Tailwind CSS code

Tailwindo This tool can convert Your CSS framework (currently Bootstrap) classes in HTML/PHP (any of your choice) files to equivalent Tailwind CSS cla

Enhancements to Sublime Text sidebar. Files and folders.

Sidebar Enhancements In other languages Japanese - http://taamemo.blogspot.jp/2012/10/sublime-text-2-sidebarenhancements.html?m=1 Russian - https://ww

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
Renamify is a package for Laravel used to rename a file before uploaded to prevent replacing exists file which has the same name to this new uploaded file.

Renamify Laravel package for renaming file before uploaded on server. Renamify is a package for Laravel used to rename a file before uploaded to preve

MB'DUSENGE Callixte 2 Oct 11, 2022
Laravel Money.

Laravel Money Note: This project abstracts MoneyPHP Installation Run the following command from you terminal: composer require cknow/laravel-money or

ClickNow 725 Jan 2, 2023
Log executed Laravel SQL queries and their line number and more

A lightweight laravel package for logging executed SQL queries, line number and more

Md.Harun-Ur-Rashid 31 Dec 21, 2022
A small PHP library for validating VAT identification numbers (VATINs).

VATIN A small PHP library for validating VAT identification numbers (VATINs). Installation This library is available on Packagist: $ composer require

David de Boer 128 Oct 27, 2022
Phone number functionality for Laravel

Laravel Phone Adds phone number functionality to Laravel and Lumen based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents

null 2.1k Dec 31, 2022
Laravel Dutch Phone Number Validator

Laravel Dutch Phone Number Validator Validate if the given phone number is a valid Dutch phone number Table of Contents Installation Usage Translation

Tim Wassenburg 0 May 30, 2022
Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey.

Laravel Phone Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents Demo Insta

null 2.1k Jan 2, 2023
A simple validator package to check if the given zipcode has a valid Dutch zipcode format

Laravel Dutch Zipcode Validator A simple validator package to check if the given zipcode has a valid Dutch zipcode format Table of Contents Installati

Tim Wassenburg 0 May 30, 2022
University, College, and High School name generator using fakerphp/faker

FakerSchools University, College, and High School name generator using fakerphp/faker Installation Add the FakerSchools library to your composer.json

Kenny Johnson 2 Oct 20, 2022
Laravel package to convert currencies to/from Ghana Cedis(GHS).

Kudi About A Laravel package to convert currencies to/from Ghana Cedis(GHS). Installation composer require iamkarsoft\kudi Publishing config files php

Kofi Ramos 3 Jun 28, 2022