Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2966

Money ammount showing 100.00 instead of just 100

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: Unscheduled
    • Component/s: CiviContribute, CiviMember
    • Labels:
      None

      Description

      On for example membership contribution page. The membership ammount is showing the trailing decimal and the decimal sign even if the decimals are zero.

      in CRM/Utils/Money.php

      I have done the following to skip the extra decimal and digits if they are zero.

      // money_format() exists only in certain PHP install (CRM-650)
      if (is_numeric($amount) and function_exists('money_format')) {

      if(abs($amount - floor($amount))>0)

      { $amount = money_format('%!.2i', $amount); }

      else

      { $amount = money_format('%!.0i', $amount); }

      }

      the money_format is using LC_MONETARY, does civicrm set that to the current local variable for example. setlocale(LC_MONETARY, 'sv_SE'); ?

      Perhaps there is a better way to do this and perhaps this is just a swedish way you want to show the ammounts.
      Also this just seems to affect contribution pages and related, and not for example membership types pages.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              haggan Jonas Hagberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: