yadders/rupiah-redenom

A Laravel package to handle Rupiah redenomination.

Maintainers

Package info

github.com/Fenanders/rupiah-redenominasi

pkg:composer/yadders/rupiah-redenom

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.4 2025-12-02 02:17 UTC

This package is auto-updated.

Last update: 2026-03-30 07:40:02 UTC


README

Latest Version on Packagist Total Downloads

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.