
| Current Path : /var/www/html/store/vendor/commerceguys/intl/src/Formatter/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/vendor/commerceguys/intl/src/Formatter/CurrencyFormatterInterface.php |
<?php
namespace CommerceGuys\Intl\Formatter;
interface CurrencyFormatterInterface
{
/**
* Formats a currency amount.
*
* Supported options:
* - locale: The locale. Default: 'en'.
* - use_grouping: Whether to use grouping separators,
* such as thousands separators.
* Default: true.
* - minimum_fraction_digits: Minimum fraction digits.
* - maximum_fraction_digits: Minimum fraction digits.
* - rounding_mode: The rounding mode.
* A PHP_ROUND_ constant or 'none' to skip
* rounding. Default: PHP_ROUND_HALF_UP.
* - style: The style.
* One of: 'standard', 'accounting'.
* Default: 'standard'.
* - currency_display: How the currency should be displayed.
* One of: 'code', 'symbol', 'none'.
* Default: 'symbol'.
*
* Both minimum_fraction_digits and maximum_fraction_digits default
* to the currency's number of fraction digits.
*
* @param string $number The number.
* @param string $currencyCode The currency code.
* @param array $options The formatting options.
*
* @return string The formatted number.
*/
public function format($number, $currencyCode, array $options = []);
/**
* Parses a formatted currency amount.
*
* Commonly used in input widgets where the end-user might input
* a number using digits and symbols common to their locale.
*
* Supported options:
* - locale: The locale. Default: 'en'.
*
* @param string $number The formatted number.
* @param string $currencyCode The currency code.
* @param array $options The parsing options.
*
* @return string|false The parsed number or FALSE on error.
*/
public function parse($number, $currencyCode, array $options = []);
}