Page 1 of 1

How do I get rid of ,00 in a mark

Posted: Wed Nov 28, 2012 11:30 am
by 15964102
How do I get rid of ,00 in a mark.

I don't want to show the decimal.
1650 instead of 1650,00

Re: How do I get rid of ,00 in a mark

Posted: Thu Nov 29, 2012 8:40 am
by yeray
Hi Martin,

We've just revised it. Thanks for reporting it.
Here there are the changes, if you want to apply them. In Series.php you'll find the formatValue:

Code: Select all

   private function formatValue($value)  {
      $LOCALE = localeconv();      
      $tmpResult = number_format($value,2,
        $LOCALE['decimal_point'],
        $LOCALE['thousands_sep']);
     
      return $tmpResult;
   }
Change it for this:

Code: Select all

   private function formatValue($value)  {
       $LOCALE = localeconv();       
                                  
       try { // CDI TF02010053
            if (fmod((double)$value,1)!=0) {
              if ($LOCALE['frac_digits'] != $this->valuesDecimal)
                $decimals=$this->valuesDecimal;
              else
                $decimals=$LOCALE['frac_digits'];
            }
            else
              $decimals=0;

            $tmpResult = number_format($value,$decimals,
                $LOCALE['decimal_point'],
                $LOCALE['thousands_sep']);

            if ($tmpResult=='-0') {
                $tmpResult='0';
            }

        } catch (Exception $e) {
            $tmpResult = number_format($value, $decimals,
                $LOCALE['decimal_point'],
                $LOCALE['thousands_sep']);
        }
        
        return $tmpResult;                
   }

Re: How do I get rid of ,00 in a mark

Posted: Thu Nov 29, 2012 8:48 am
by 15964102
Thanks a lot! :)