Thread Starter
Michael
(@whispardesign)
Actually – the problem area had to do with the round function – that threw the error. For reference – what is the correct usage of the rounding function – when added to the file it is added as Math.round(
Hello, @whispardesign
To avoid misunderstandings, please describe your case in more detail, as we did not identify this issue by following the link you provided.
Also, please make sure your system requirements are correct:
https://docs.stylemixthemes.com/cost-calculator-builder/getting-started/system-requirements
Best regards.
Thread Starter
Michael
(@whispardesign)
System requirements are fine – the problem was not with 3.0 but with the rounding function as I described.
Please go back to that page and click the “How much grass do you need” button and enter 100 and 100 in the fields. You will see that the “pallets needed” is not rounding.
When I add the Round function Math.round( in the calculator settings it breaks.
Can you please provide a sample code using the round function that works – perhaps I am not entering it correctly or there is a bug.
Best,
Michael
Thread Starter
Michael
(@whispardesign)
This is my current formula without rounding
quantity_field_id_6 * quantity_field_id_1 * 2 / 900
Hi, @whispardesign
We checked this case on our test calculator and did not experience any difficulties.
Please make sure that your website does not have third-party plugins installed that may interfere with the calculator’s logic.
Regards.
Thread Starter
Michael
(@whispardesign)
I am simply asking for you to show me the proper syntax for using the round function.
Please post an example with my existing formula above to round to 2 places.
Thank You
Hello,
I created a similar calculator in our testing environment and used the following calculations in the Formula field:
Math.round( quantity_field_id_0 * (quantity_field_id_2 * 2 / 900))
You can see results from this screenshot:
Regards
Thread Starter
Michael
(@whispardesign)
Thank you Eric.
Still having a few issues adapting to our forumla.
(quantity_field_id_0 * quantity_field_id_1 * (quantity_field_id_2 /12 ) ) / 27
If I simply add Math.Round it breaks.
Do you mind taking my formula and adapting your test with rounding?
Not sure where I am going wrong :/
Thanks for the assistance.
Hello,
I tested your formula with Math.round() (Screenshot).
I used the following calculations in the Formula field:
Math.round( (quantity_field_id_0 * quantity_field_id_2 * (quantity_field_id_3 /12 ) ) / 27)
The calculator elements can be seen from this screenshot
Please try to create a similar calculator on your own and recheck the issue.
Regards
Thread Starter
Michael
(@whispardesign)
Thank you Eric – All good – works like a charm!
You are welcome @whispardesign 🙂
If you’re satisfied with our response and think we are worth five stars, I would request you to post a review for our plugin.
https://wordpress.org/plugins/cost-calculator-builder/#reviews
Your kind words will encourage our team a lot and we will get the motivation to deliver better products and services in the future.
Kind Regards