misbah/money-in-words
Composer 安装命令:
composer require misbah/money-in-words
包简介
Converts Money or Number into Words according to Bangladeshi Convention
README 文档
README
This package converts Money or Number into Words according to Bangladeshi Convention
Installation
use composer require misbah/money-in-words to install
Usage
Convert a number & get the result as an array
The 0th index will contain the word representation of the integer part & the 1st index will contain the word representing the fraction part
<?php
require './vendor/autoload.php';
$converter = new \MoneyInwords\MoneyInWords();
$number = 1.03;
print_r($converter->numberToWords($number));
echo "<br>";
$number = 0.1;
print_r($converter->numberToWords($number));
echo "<br>";
$number = 3125639562;
var_dump($converter->numberToWords($number));
/* Outputs
Array ( [0] => one [1] => three )
Array ( [0] => twelve crore sixty five lac forty three thousand nine hundred and eighty one [1] => ten )
array(2) { [0]=> string(12) "ten thousand" [1]=> string(0) "" }
*/
Convert a number into words as Bangladeshi Money
This function will return a string containing the Words in Money
<?php
require './vendor/autoload.php';
$converter = new \MoneyInwords\MoneyInWords();
$number = 1.03;
print_r(ucwords($converter->moneyToWords($number)));
echo "<br>";
$number = 0.1;
print_r(ucwords($converter->moneyToWords($number)));
echo "<br>";
$number = 3125639562;
print_r(ucwords($converter->moneyToWords($number)));
/* Outputs
One Taka And Three Paisa
Zero Taka And Ten Paisa
Three Hundred And Twelve Crore Fifty Six Lac Thirty Nine Thousand Five Hundred And Sixty Two Taka
*/
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-03