We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 33e400e0 authored by rikterbeek's avatar rikterbeek

Added helper to retrieve original amount

parent 239011d3
...@@ -157,6 +157,48 @@ class Data extends AbstractHelper ...@@ -157,6 +157,48 @@ class Data extends AbstractHelper
return number_format($amount, $format, '', ''); return number_format($amount, $format, '', '');
} }
public function originalAmount($amount, $currency)
{
// check the format
switch($currency) {
case "JPY":
case "IDR":
case "KRW":
case "BYR":
case "VND":
case "CVE":
case "DJF":
case "GNF":
case "PYG":
case "RWF":
case "UGX":
case "VUV":
case "XAF":
case "XOF":
case "XPF":
case "GHC":
case "KMF":
$format = 1;
break;
case "MRO":
$format = 10;
break;
case "BHD":
case "JOD":
case "KWD":
case "OMR":
case "LYD":
case "TND":
$format = 1000;
break;
default:
$format = 100;
break;
}
return ($amount / $format);
}
/** /**
* Street format * Street format
* @param type $address * @param type $address
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment