PHP 简单货币格式化工具。

v3.0.1 2020-08-05 13:40 UTC

README

StyleCI Build Status

// Parse a document.
$dosh = new Dosh(Dosh::GBP);
$dosh->format('25.43'); // £25.430

// Dependency injection example.
$dosh->format("100");

// Change currency
$dosh = new Dosh(Dosh::USD);
$dosh->format("100"); // $100

安装

使用 Composer 在项目根目录中安装此包。

composer require bluebaytravel/dosh

Laravel 安装

将服务提供者添加到 config/app.php 文件中的 providers 数组。

BlueBayTravel\Dosh\DoshServiceProvider::class

如果您想使用 facade,可以在 config/app.php 文件中将引用添加到您的别名数组中。

'Dosh' => BlueBayTravel\Dosh\Facades\Dosh::class

许可证

Blue Bay Travel Dosh 使用 MIT 许可证 (MIT) 许可。