X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FMoney.php;h=22d5551dd78c4d36f810542a661ec67454f0c542;hb=725b3de6f03330ab5e310f397fc0336fe551ec6f;hp=b196f1a6a4827ccb50a04c85d4977897f9dfa468;hpb=e7f7aef7265627c99d27b5e9cecdfe5d3e50f7de;p=civicrm-core.git diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php index b196f1a6a4..22d5551dd7 100644 --- a/CRM/Utils/Money.php +++ b/CRM/Utils/Money.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -40,7 +40,7 @@ class CRM_Utils_Money { static $_currencySymbols = NULL; /** - * Format a monetary string + * Format a monetary string. * * Format a monetary string basing on the amount provided, * ISO currency code provided and a format string consisting of: @@ -49,17 +49,21 @@ class CRM_Utils_Money { * %C - the currency ISO code (e.g., 'USD') if provided * %c - the currency symbol (e.g., '$') if available * - * @param float $amount the monetary amount to display (1234.56) - * @param string $currency the three-letter ISO currency code ('USD') - * @param string $format the desired currency format + * @param float $amount + * The monetary amount to display (1234.56). + * @param string $currency + * The three-letter ISO currency code ('USD'). + * @param string $format + * The desired currency format. * @param bool $onlyNumber - * @param string $valueFormat the desired monetary value display format (e.g. '%!i') + * @param string $valueFormat + * The desired monetary value display format (e.g. '%!i'). * - * @return string formatted monetary string + * @return string + * formatted monetary string * - * @static */ - static function format($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE, $valueFormat = NULL) { + public static function format($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE, $valueFormat = NULL) { if (CRM_Utils_System::isNull($amount)) { return ''; @@ -84,7 +88,10 @@ class CRM_Utils_Money { } if (!self::$_currencySymbols) { - self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('keyColumn' => 'name', 'labelColumn' => 'symbol')); + self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array( + 'keyColumn' => 'name', + 'labelColumn' => 'symbol', + )); } if (!$currency) { @@ -119,5 +126,5 @@ class CRM_Utils_Money { ); return strtr($format, $replacements); } -} +}