CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can I remove .00 (cents) monetary display using Global Settings Localization?
Pages: [1]

Author Topic: Can I remove .00 (cents) monetary display using Global Settings Localization?  (Read 895 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Can I remove .00 (cents) monetary display using Global Settings Localization?
August 01, 2011, 11:14:11 am
Don't need the .00 to be displayed after the monetary value on contribution pages.  I don't understand the code for monetary display and http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+Localisation doesn't offer any clues into Monetary Value Display current value: %!i

Can someone point me in a direction to remove .00 publically, or shall I just use jQuery to do it?  Thanks.
« Last Edit: August 01, 2011, 11:18:59 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Can I remove .00 (cents) monetary display using Global Settings Localization?
August 01, 2011, 04:05:23 pm
Stuart - If you want this change globally for the site, looks like this works (quick test): %!.0i

I figured this out by checking the PHP function used in CRM/Utils/Money.php (money_format):
http://php.net/manual/en/function.money-format.php

Don't know if there might be unintended side-effects ?? but it SHOULD only affect display.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can I remove .00 (cents) monetary display using Global Settings Localization?

This forum was archived on 2017-11-26.