Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

demical points dont show 30.05.2013 14:37

Hi there we have set the result to diplay to two decimal points. Could you help us witha small problem. the results show up and work fine but if the result amount does not need two decimals it removes the zero

For example if result is 3.56 it works but if result is 3.30 its drops the zero and displays it as 3.3

Because this is a currency value i need the zero to show up please help with this

Re: demical points dont show 31.05.2013 09:02

Hello,
in order to have fixed decimal positions, you have to apply a format to the number once you have finished calculations. Assuming that you have your number stored at the variable $result, you should add this line at the end of your code section:


$result=number_format($result,2);


This will format the number to 2 decimal positions.

More information and examples about number_format function here:


http://php.net/manual/en/function.number-format.php


Hope this helps, regards
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback