@@ 37-47 (lines=11) @@ | ||
34 | * @param null $locale |
|
35 | * @return bool|string |
|
36 | */ |
|
37 | public function formatI18nDecimal(Money $money, $locale = null) |
|
38 | { |
|
39 | if ($locale === null) { |
|
40 | $locale = $this->locale; |
|
41 | } |
|
42 | ||
43 | $numberFormatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL); |
|
44 | $moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies()); |
|
45 | ||
46 | return $moneyFormatter->format($money); |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * localized format for money with the NumberFormatter class in Currency mode |
|
@@ 58-68 (lines=11) @@ | ||
55 | * @param null $locale |
|
56 | * @return bool|string |
|
57 | */ |
|
58 | public function formatI18n(Money $money, $locale = null) |
|
59 | { |
|
60 | if ($locale === null) { |
|
61 | $locale = $this->locale; |
|
62 | } |
|
63 | ||
64 | $numberFormatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY); |
|
65 | $moneyFormatter = new IntlMoneyFormatter($numberFormatter, new ISOCurrencies()); |
|
66 | ||
67 | return $moneyFormatter->format($money); |
|
68 | } |
|
69 | ||
70 | /** |
|
71 | * gets currency symbol |