Answers.Body: <p>While not a supported option, theoretically you can replace <code>\Civi::$statics[$cacheKey];</code> from <a href="https://github.com/civicrm/civicrm-core/blob/b0fff1c64cf3dd2e40b248b3b067ca30de09aeee/Civi/Core/Format.php#L220" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/b0fff1c64cf3dd2e40b248b3b067ca30de09aeee/Civi/Core/Format.php#L220</a>, probably in hook_civicrm_config in an extension, with a modified $formatter object that does what you want.</p>
  <p>e.g. in hook_civicrm_config</p>
  <pre><code>$cacheKey = &lt;figure out cachekey&gt;
  $formatter = \Civi::$statics[$cacheKey];
  // make some changes to $formatter here
  \Civi::$statics[$cacheKey] = $formatter;
  </code></pre>
  <p>But it would be nicer if there was a supported way to change the parameters that the formatter object uses.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T21:21:48.053Z
Answers.Text: Wouldn't it be easier to have a copy of Money.php in custom php directory and alter   getCurrencyPrecision() ?
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T21:39:50.247Z
Answers.Text: It makes upgrades harder if you need to sync changes every time, but yes that should work too.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T22:58:17.707Z
Answers.Text: Indeed; I was thinking about a tiny extension which would extend the CRM_Utils_Money class, just not sure which hook to use.
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T23:33:25.030Z
Answers.Text: If we assume the target audience for customizing is developers, then I think the solution to that would be to change [this line in core](https://github.com/civicrm/civicrm-core/blob/be1dda3865ab9e84ab5af740ad7fcb6bebaa4b9e/Civi.php#L138) so that it acts like a service, similar to [the logger](https://github.com/civicrm/civicrm-core/blob/be1dda3865ab9e84ab5af740ad7fcb6bebaa4b9e/Civi.php#L96), so that you could replace it like the way [monolog does](https://lab.civicrm.org/extensions/monolog/-/blob/81786bd2b346ec8bb7d1227ef0c4522ddc6d644c/monolog.php#L150).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T23:34:12.697Z
Answers.Text: That would replace the entire Format class not just the money formatter, but it's the same idea, you'd extend it, and just override the part you need.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-06T20:55:09.573Z
Answers.LastActivityDate: 2023-01-06T20:55:09.573Z
Answers.UserDisplayName: Demerit
Body: <p>Based on this <a href="https://forum.civicrm.org/index.php%3Ftopic=3876.0.html" rel="nofollow noreferrer">year 2008</a> thread and a few earlier threads on civi.stackexchange regarding the matter.  Now (CiviCRM 5.56.2), when &quot;Monetary Amount Display&quot; on civicrm/admin/setting/localization?reset=1 is deprecated and gone, how do we, say, remove decimals from currency display, apart from altering <code>CRM_Utils_Money</code>?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-06T16:53:03.790Z
Comments.Text: Same interest in altering: https://lab.civicrm.org/dev/core/-/issues/1494#note_65518
Comments.UserDisplayName: Andy Burns
Tags: <currency>
Title: How to manage monetary display in 2023?
ThreadText: # How to manage monetary display in 2023?
  
  (Asked by: username_0 on 2023-01-06)
  
  Based on this [year 2008](https://forum.civicrm.org/index.php%3Ftopic=3876.0.html) thread and a few earlier threads on civi.stackexchange regarding the matter. Now (CiviCRM 5.56.2), when "Monetary Amount Display" on civicrm/admin/setting/localization?reset=1 is deprecated and gone, how do we, say, remove decimals from currency display, apart from altering `CRM_Utils_Money`?
  
  **Tags:** currency
  
  > **Comments:**
  > **username_1**: Same interest in altering: https://lab.civicrm.org/dev/core/-/issues/1494#note_65518  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-01-06. Score: 1
  
  While not a supported option, theoretically you can replace \Civi::$statics[$cacheKey]; from https://github.com/civicrm/civicrm-core/blob/b0fff1c64cf3dd2e40b248b3b067ca30de09aeee/Civi/Core/Format.php#L220, probably in hook_civicrm_config in an extension, with a modified $formatter object that does what you want.
  e.g. in hook_civicrm_config
  $cacheKey = 
  $formatter = \Civi::$statics[$cacheKey];
  // make some changes to $formatter here
  \Civi::$statics[$cacheKey] = $formatter;
  
  But it would be nicer if there was a supported way to change the parameters that the formatter object uses.
  
  > **Comments:**
  > **username_0**: Wouldn't it be easier to have a copy of Money.php in custom php directory and alter   getCurrencyPrecision() ?  
  > **username_2**: It makes upgrades harder if you need to sync changes every time, but yes that should work too.  
  > **username_0**: Indeed; I was thinking about a tiny extension which would extend the CRM_Utils_Money class, just not sure which hook to use.  
  > **username_2**: If we assume the target audience for customizing is developers, then I think the solution to that would be to change [this line in core](https://github.com/civicrm/civicrm-core/blob/be1dda3865ab9e84ab5af740ad7fcb6bebaa4b9e/Civi.php#L138) so that it acts like a service, similar to [the logger](https://github.com/civicrm/civicrm-core/blob/be1dda3865ab9e84ab5af740ad7fcb6bebaa4b9e/Civi.php#L96), so that you could replace it like the way [monolog does](https://lab.civicrm.org/extensions/monolog/-/blob/81786bd2b346ec8bb7d1227ef0c4522ddc6d644c/monolog.php#L150).  
  > **username_2**: That would replace the entire Format class not just the money formatter, but it's the same idea, you'd extend it, and just override the part you need.  
  
  ---
  
  