Skip to content
Snippets Groups Projects
Commit 6adfaa0e authored by benmoreassynt's avatar benmoreassynt
Browse files

Fix empty string $amount error

parent d1811294
Branches
Tags
No related merge requests found
......@@ -117,6 +117,10 @@ class CRM_Utils_Number {
* @throws \Brick\Money\Exception\UnknownCurrencyException
*/
public static function formatLocaleNumeric(string $amount, $locale = NULL): string {
if ($amount === "") {
return $amount;
}
$formatter = new \NumberFormatter($locale ?? CRM_Core_I18n::getLocale(), NumberFormatter::DECIMAL);
$formatter->setSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL, CRM_Core_Config::singleton()->monetaryDecimalPoint);
$formatter->setSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL, CRM_Core_Config::singleton()->monetaryThousandSeparator);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment