此包帮助开发者将数字转换为所有语言在 Laravel 框架 PHP 上的单词

v1.0.1 2017-09-22 13:41 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:05:38 UTC


README

  • 此包与 Laravel >=5 & <= 8.0 兼容

  • notowo 是一个将数字转换为单词的包

运行 Composer update 命令

$ composer require hekmatinasser/notowo

在您的 config/app.php 文件的 providers 数组末尾添加 Hekmatinasser\Notowo\NotowoServiceProvider::class,,并在 alias 数组末尾添加 'Notowo' => Hekmatinasser\Notowo\Notowo::class,

'providers' => [

    ...
    Hekmatinasser\Notowo\NotowoServiceProvider::class,

],

'alias' => [

    ...
    'Notowo' => Hekmatinasser\Notowo\Notowo::class,
]

基本用法

Notowo

您可以在项目中使用 Notowo

use Notowo;

构造函数

return notowo('125000'); // one hundred and twenty and five thousand
return new Notowo('125000'); // one hundred and twenty and five thousand
return Notowo::parse(125000); // one hundred and twenty and five thousand

//max 39 digit
return notowo('653484112849950468404684114841147284520', 'fa');
ششصد و پنجاه و سه دسیلیون و چهارصد و هشتاد و چهار نونیلیون و صد و دوازده اکتریلیون و هشتصد و چهل و نه سپتریلیون و نهصد و پنجاه سکستریلیون و چهارصد و شصت و هشت کوینتریلیون و چهارصد و چهار کادریلیون و ششصد و هشتاد و چهار تریلیون و صد و چهارده بیلیون و هشتصد و چهل و یک میلیارد و صد و چهل و هفت میلیون و دویست و هشتاد و چهار هزار و پانصد و بیست

本地化

return new Notowo('125000', 'fa'); // صد و بیست و پنج هزار
$w = notowo('125000');
return $w->setLang('fa'); // صد و بیست و پنج هزار
return $w->getLang(); // fa
return $w->resetLang(); // one hundred and twenty and five thousand

货币

$w = Notowo::parse(125000, 'fa');
return $w->currency(); // صد و بیست و پنج هزار ریال
return $w->currency('تومان');

return $w->setCurrency('تومان'); 
return $w->getCurrency(); // تومان
return $w->resetCurrency(); // صد و بیست و پنج هزار

许可证

  • 此包由 Nasser Hekmati 创建并修改,用于 Laravel >= 5,并发布在 MIT 许可证下。查看作者