Forum Discussion
Subtract numerical variables giving wrong answer
I'm working on a course with a calculation using numerical variables. Sorry if this is confusing but I've tried to attach picture to illustrate what I mean.
I've set it to subtract one variable from the other and it's giving the wrong answer (picture attached).
I've checked the subtraction using two numerical entry boxes and the same mistake is made (picture attached - unrounded number being subtracted) which I think suggests it's a problem within storyline rather than how I've set up the calculator.
Storyline is showing that 2088.71 - 322.5852 = 1766.13 when it actually equals 1766.1248 (which should round down to 1766.12). If I subtract the rounded number (322.59), it gives the correct answer (picture attached) so I think it may be an issue with the way storyline rounds numerical variables.
I'm using real world numbers so there's no way of making it a simpler calculation to avoid this issue. The only solution I came up with is adding a trigger along the lines of 'if (variable being subtracted) = 322.5852 then set it to 322.59' but that doesn't work as storyline automatically rounds in the trigger wizard (picture attached) and anyway that would only solve the issue in this specific situation.
Is there a way of setting numbers to round to the nearest 0.01 - or better yet fixing the issue within storyline!
Thanks
- MariaCSStaff
Hi, Rachel.
Thank you for opening a support case and for submitting a feature request! I see you worked with my teammate Christopher, who clarified how Storyline works with decimals.
Please reach out to Christopher through the case if you have additional questions.