Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display percentage (2 figures)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-16-2013, 03:57 AM
 
weckie weckie is offline
 

eXpert
  
Join Date: Feb 2005
Location: Netherlands
Posts: 220
 

Default Display percentage (2 figures)

I have a Math formule in the admin section which calculates a percentage.

The outcome is displayed as: 42.3785466589%

I would like to have it shortened to just 2 figures like: 42%

How can i achieve that.

Thanks
__________________
Herman Steijn

Using: X-cart 4.5.4
AT: http://www.weckonline.com LIVE
Reply With Quote
  #2  
Old 03-16-2013, 04:14 AM
 
weckie weckie is offline
 

eXpert
  
Join Date: Feb 2005
Location: Netherlands
Posts: 220
 

Wink Re: Display percentage (2 figures)

AH...

Just found it on the smarty website.

just put |round:"0" in you rsmart variable and it does the job.

f.i. {$percentage|round:"0"}
__________________
Herman Steijn

Using: X-cart 4.5.4
AT: http://www.weckonline.com LIVE
Reply With Quote

The following user thanks weckie for this useful post:
tartaglia (03-19-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:12 PM.

   

 
X-Cart forums © 2001-2020