add locale param to smarty crmMoney()
authorLuciano Spiegel <l.spiegel@ixiam.com>
Fri, 3 Mar 2023 09:39:13 +0000 (10:39 +0100)
committerLuciano Spiegel <l.spiegel@ixiam.com>
Fri, 3 Mar 2023 09:39:13 +0000 (10:39 +0100)
CRM/Core/Smarty/plugins/modifier.crmMoney.php

index 4a764b9669baf62df3bd23987b75fdc02500a245..9d49c143c2dee6aac30e55cc9771b9b5dc2aefc5 100644 (file)
  *   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