yadders/rupiah-redenom
最新稳定版本:v1.0.4
Composer 安装命令:
composer require yadders/rupiah-redenom
包简介
A Laravel package to handle Rupiah redenomination.
README 文档
README
A simple Laravel package to help with the planned Indonesian Rupiah redenomination. This package provides a simple way to "simplify" a Rupiah value (e.g., from 1,000 to 1) and format it.
Installation
You can install the package via composer:
composer require yadders/rupiah-redenom
The package will automatically register its service provider and facade.
Usage
You can use the Rupiah facade to access the package's functionality.
Simplifying Rupiah Values
The simplifyRupiah method divides a given value by 1000 (the default divisor for the redenomination).
use Yadders\RupiahRedenom\Facades\Rupiah; // Basic simplification $oldRupiah = 1000000; $newRupiah = Rupiah::simplifyRupiah($oldRupiah); // Returns 1000.0 $anotherOldRupiah = 5500; $anotherNewRupiah = Rupiah::simplifyRupiah($anotherOldRupiah); // Returns 5.5
You can also provide a custom divisor:
use Yadders\RupiahRedenom\Facades\Rupiah; $value = 10000; $simplified = Rupiah::simplifyRupiah($value, 100); // Returns 100.0
Formatting as Rupiah
The format method formats a number into a Rupiah string.
use Yadders\RupiahRedenom\Facades\Rupiah; $value = 12345.67; $formatted = Rupiah::format($value); // Returns "Rp 12.345,67" $simplifiedValue = Rupiah::simplifyRupiah(500000); // 500.0 $formattedSimplified = Rupiah::format($simplifiedValue); // Returns "Rp 500,00"
Testing
To run the package's tests, use the following command:
composer test
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2025-12-01