1: <?php
2:
3: namespace Deimos\Helper\Helpers;
4:
5: use Deimos\Helper\AbstractHelper;
6:
7: class Money extends AbstractHelper
8: {
9:
10: 11: 12: 13: 14: 15: 16: 17:
18: public function format($amount, $locale = 'en')
19: {
20: switch ($locale)
21: {
22: case 'de':
23: case 'tr':
24: case 'pt':
25: case 'it':
26: case 'nl':
27: $amount = number_format($amount, 2, ',', '.');
28: break;
29:
30: case 'fr':
31: case 'ru':
32: $amount = number_format($amount, 2, ',', ' ');
33: break;
34:
35: case 'en':
36: $amount = number_format($amount, 2, '.', ',');
37: break;
38: }
39:
40: return $amount;
41: }
42:
43: }
44: