22 lines
479 B
PHP
22 lines
479 B
PHP
<?php
|
|
|
|
if (! function_exists('removeRupiahFormatting')) {
|
|
function removeRupiahFormatting($value)
|
|
{
|
|
$convertedValue = str_replace(['Rp', '.', ' '], '', $value);
|
|
|
|
$convertedValue = str_replace(',', '.', $convertedValue);
|
|
|
|
return $convertedValue;
|
|
}
|
|
}
|
|
|
|
if (! function_exists('formatToRupiah')) {
|
|
function formatToRupiah($value)
|
|
{
|
|
$valueFormatted = 'Rp'.number_format($value, 2, ',', '.');
|
|
|
|
return $valueFormatted;
|
|
}
|
|
}
|