NumericHelper.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. App::uses('NumberHelper', 'View/Helper');
  3. //App::uses('NumberLib', 'Tools.Utility');
  4. /**
  5. * Todo: rename to MyNumberHelper some day?
  6. * Aliasing it then as Number again in the project
  7. *
  8. */
  9. class NumericHelper extends NumberHelper {
  10. //public $helpers = array();
  11. /*
  12. protected $_settings = array(
  13. );
  14. protected $code = null;
  15. protected $places = 0;
  16. protected $symbolRight = null;
  17. protected $symbolLeft = null;
  18. protected $decimalPoint = '.';
  19. protected $thousandsPoint = ',';
  20. */
  21. public function __construct($View = null, $settings = []) {
  22. $settings = Set::merge(['engine' => 'Tools.NumberLib'], $settings);
  23. parent::__construct($View, $settings);
  24. /*
  25. $i18n = Configure::read('Currency');
  26. if (!empty($i18n['code'])) {
  27. $this->code = $i18n['code'];
  28. }
  29. if (!empty($i18n['places'])) {
  30. $this->places = $i18n['places'];
  31. }
  32. if (!empty($i18n['symbolRight'])) {
  33. $this->symbolRight = $i18n['symbolRight'];
  34. }
  35. if (!empty($i18n['symbolLeft'])) {
  36. $this->symbolLeft = $i18n['symbolLeft'];
  37. }
  38. if (isset($i18n['decimals'])) {
  39. $this->decimalPoint = $i18n['decimals'];
  40. }
  41. if (isset($i18n['thousands'])) {
  42. $this->thousandsPoint = $i18n['thousands'];
  43. }
  44. */
  45. }
  46. }