I noticed that references to numbered variables indicate they default to two decimal places when output. Is there a way to change them to whole numbers (no decimal places)?
You can use a Javascript trigger to round out a variable when that variable changes, then copy/paste the trigger and assign it to any other relevant number variables.
However, continuous rounding may lead to incorrect results if the variables change frequently - i.e. Rounded 1.5 + Rounded 1.5 + Rounded 1.5 = 6
So you could either use carry-over variables or just round them out in the end (this depends on what exactly you're going for).
Thank you for your suggestion Alexandros. I'm not to concerned about the continuous rounding issue in this case as it shouldn't present any problem, however I'm not sure what the JavaScript trigger would look like. Do you have an example of this?
4 Replies
This discussion may help you.
You can use a Javascript trigger to round out a variable when that variable changes, then copy/paste the trigger and assign it to any other relevant number variables.
However, continuous rounding may lead to incorrect results if the variables change frequently - i.e. Rounded 1.5 + Rounded 1.5 + Rounded 1.5 = 6
So you could either use carry-over variables or just round them out in the end (this depends on what exactly you're going for).
Hi Bob! Looks like you are getting some great assistance here :)
Thank you for your suggestion Alexandros. I'm not to concerned about the continuous rounding issue in this case as it shouldn't present any problem, however I'm not sure what the JavaScript trigger would look like. Do you have an example of this?
This discussion is closed. You can start a new discussion or contact Articulate Support.