How do I get rid of ,00 in a mark

TeeChart for PHP
Post Reply
Martin
Newbie
Newbie
Posts: 11
Joined: Tue Nov 13, 2012 12:00 am

How do I get rid of ,00 in a mark

Post by Martin » Wed Nov 28, 2012 11:30 am

How do I get rid of ,00 in a mark.

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

Yeray
Site Admin
Site Admin
Posts: 8730
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Thu Nov 29, 2012 8:40 am

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;                
   }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Martin
Newbie
Newbie
Posts: 11
Joined: Tue Nov 13, 2012 12:00 am

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

Post by Martin » Thu Nov 29, 2012 8:48 am

Thanks a lot! :)

Post Reply