Added Pakistani Rupee

This commit is contained in:
Hillel Coren 2016-05-05 22:49:09 +03:00
parent 32c912f7b1
commit 5249ae0291
3 changed files with 6 additions and 2 deletions

View File

@ -341,6 +341,7 @@ class Utils
$currency = self::getFromCache($currencyId, 'currencies'); $currency = self::getFromCache($currencyId, 'currencies');
$thousand = $currency->thousand_separator; $thousand = $currency->thousand_separator;
$decimal = $currency->decimal_separator; $decimal = $currency->decimal_separator;
$precision = $currency->precision;
$code = $currency->code; $code = $currency->code;
$swapSymbol = false; $swapSymbol = false;
@ -355,7 +356,7 @@ class Utils
} }
} }
$value = number_format($value, $currency->precision, $decimal, $thousand); $value = number_format($value, $precision, $decimal, $thousand);
$symbol = $currency->symbol; $symbol = $currency->symbol;
if ($showCode || !$symbol) { if ($showCode || !$symbol) {

View File

@ -8,6 +8,7 @@ class CurrenciesSeeder extends Seeder
{ {
Eloquent::unguard(); Eloquent::unguard();
// http://www.localeplanet.com/icu/currency.html
$currencies = [ $currencies = [
['name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Pound Sterling', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Pound Sterling', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
@ -56,6 +57,7 @@ class CurrenciesSeeder extends Seeder
['name' => 'Japanese Yen', 'code' => 'JPY', 'symbol' => '¥', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Japanese Yen', 'code' => 'JPY', 'symbol' => '¥', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Pakistani Rupee', 'code' => 'PKR', 'symbol' => 'Rs ', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
]; ];
foreach ($currencies as $currency) { foreach ($currencies as $currency) {

View File

@ -66,6 +66,7 @@
} }
var currency = currencyMap[currencyId]; var currency = currencyMap[currencyId];
var precision = currency.precision;
var thousand = currency.thousand_separator; var thousand = currency.thousand_separator;
var decimal = currency.decimal_separator; var decimal = currency.decimal_separator;
var code = currency.code; var code = currency.code;
@ -82,7 +83,7 @@
} }
} }
value = accounting.formatMoney(value, '', 2, thousand, decimal); value = accounting.formatMoney(value, '', precision, thousand, decimal);
var symbol = currency.symbol; var symbol = currency.symbol;
if (hideSymbol) { if (hideSymbol) {