CalcBuilder Forum

Number format

User _MSTeam# 2014-05-19 09:05:44

We need to apply a number format to the calculator in the cost table. This is the format we want to follow:


I saw an old post where you showed someone how to do it in PHP (which we don't want to do since our calc is now quite complicated) - but with the new version you have a section on number format for decimal and '000' spacing - why is there no button to turn this on?

Please help!

User _MSTeam# 2014-05-19 09:11:42

the format parameters you can see at the backend configure the numeric format allowed for users to type at the input form. It's applied to any input field typed 'number'. In order to configure the output format you must use the number_format function at the code section.

For your specific calculator, you have the results assigned at the last line of the calculator:


so you only need to add the numeric format before that line:


//You can change 0 for the number of decimal positions you want to force at the results.

Hope this helps, regards


Perfect for small code changes or to correct any bug at your site

Buy now!

Create dynamic calculators

Buy now!