From 7ae56b4259752bec1c9f9b4ec38de2a74d9b4763 Mon Sep 17 00:00:00 2001 From: Luciano Spiegel Date: Fri, 3 Mar 2023 10:39:13 +0100 Subject: [PATCH] add locale param to smarty crmMoney() --- CRM/Core/Smarty/plugins/modifier.crmMoney.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Smarty/plugins/modifier.crmMoney.php b/CRM/Core/Smarty/plugins/modifier.crmMoney.php index 4a764b9669..9d49c143c2 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmMoney.php +++ b/CRM/Core/Smarty/plugins/modifier.crmMoney.php @@ -22,13 +22,15 @@ * The monetary amount up for display. * @param string|null $currency * The (optional) currency. + * @param string|null $locale + * The (optional) locale. * * @return string * formatted monetary amount */ -function smarty_modifier_crmMoney($amount, ?string $currency = NULL): string { +function smarty_modifier_crmMoney($amount, ?string $currency = NULL, ?string $locale = NULL): string { try { - return Civi::format()->money($amount, $currency); + return Civi::format()->money($amount, $currency, $locale); } catch (CRM_Core_Exception $e) { // @todo escalate this to a deprecation notice. It turns out to be depressingly -- 2.25.1