upgrade all with dice compatible

This commit is contained in:
2026-08-22 12:53:04 +07:00
parent 27ebdca49b
commit e7bb9a6c90
34 changed files with 546 additions and 486 deletions
+12 -11
View File
@@ -6,9 +6,9 @@
Desc. : Fungsi Custom Lain Lain
Created By : Siau Pheng ([email protected]).
Created Date : January 27th, 2008.
Last Modified : December 26th, 2025.
Last Modified : August 21st, 2026.
(c) 2008 - 2025, 3FONIA Software; WWW.3FONIA.COM.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
@@ -17,24 +17,25 @@ declare(strict_types=1);
/*************************** FORMAT ANGKA / CURRENCY *****************************/
if (!function_exists('rupiah')) {//oke
function rupiah(string|float $angka = 0, int $desi = 0) {
function rupiah(string|float $angka = 0, int $desi = 0): string {
return number_format((float)$angka, $desi, ",", ".");
}
}
if (!function_exists('rupiah2')) {
function rupiah2($angka = 0) {
if (!function_exists('rupiah2')) {//oke
function rupiah2($angka = 0): string {
return rupiah($angka, 2);
}
}
if (!function_exists('rupiah30')) {
function rupiah30($angka = 0) {
//todo: deprecated
/*if (!function_exists('rupiah30')) {
function rupiah30($angka = 0): string {
$nilai = explode(".", $angka);
$hasil = (intval($nilai[1])==0) ? rupiah($angka, 0) : rupiah($angka, 3);
return $hasil;
}
}
}*/
if (!function_exists('kurung_rup')) {
function kurung_rup($angka = 0, $desi = 0) {
@@ -284,9 +285,9 @@ if (!function_exists('br2nl')) {
}
}
if (!function_exists('isi_nol')) {
function isi_nol($nilai = "0", $panjang = 1) {
$nilai = strval($nilai);
if (!function_exists('isi_nol')) {//oke
function isi_nol(string|int $nilai = 0, int $panjang = 1): string {
$nilai = (string)$nilai;
return ($panjang>strlen($nilai) ? str_repeat("0", $panjang-strlen($nilai)):'').$nilai;
}
}