FormatInterface.php 892 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Locale;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. interface FormatInterface
  12. {
  13. /**
  14. * Returns the first found number from a string
  15. * Parsing depends on given locale (grouping and decimal)
  16. *
  17. * Examples for input:
  18. * ' 2345.4356,1234' = 23455456.1234
  19. * '+23,3452.123' = 233452.123
  20. * ' 12343 ' = 12343
  21. * '-9456km' = -9456
  22. * '0' = 0
  23. * '2 054,10' = 2054.1
  24. * '2'054.52' = 2054.52
  25. * '2,46 GB' = 2.46
  26. *
  27. * @param string|float|int $value
  28. * @return float|null
  29. */
  30. public function getNumber($value);
  31. /**
  32. * Returns an array with price formatting info for js function
  33. * formatCurrency in js/varien/js.js
  34. *
  35. * @return array
  36. */
  37. public function getPriceFormat();
  38. }