Forum


Calc Builder Support

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

2 Digits Result 06.12.2011 00:19

Hi,
after some operations, i've gotr a result. However i would like the result to be a 2 digits result, like 215.60€. I can only have an answer like 215.5985€.
Is there an easy way to obtain that kind of result ?
Thanks for your help.

Re: 2 Digits Result 06.12.2011 11:59

Hello,
to format numbers before showing the results, you should use number_format function, where you can specify number of decimals and decimal/thousand separators. Usually this should be done at the last lines of the code, when all math is finished. To check an example we suggest to download and import the example calculator '4 basic operations & formatting numbers' here:

http://components.moonsoft.es/downloadcalcbuilder

where you can see how different formatting are applied to the results.

Hope this helps, best regards
Moonsoft Team
Moonsoft Team
www.moonsoft.es

Re: 2 Digits Result 06.12.2011 12:28

Thanks, works like a charm !
Have a nice day.
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback