We have conceived a captivate project (Captivate 2017) in which learners get the opportunity to train their ability to figure out the exact prices of different packages of our product.
With 8 given package constellations in the shopping cart the learner is asked to type in what she/he assumes as the correct price. Using an advanced action and variables after entering the learne’s input will be displayed, the correct price (i.e. the right answer), and the difference is calculated. ( 1. “Your price enty” / 2. “correct prince” / 3. “You charged xx.xx Euro too much / too little” )
Our variable is as follows:
v_difference – v_correct_price – v_customer_x_input
With the learner’s input of smooth amounts everything works fine. But if the learner enters a price that is by (let’s say) 20 cents too much or too little the calculated and displayed difference s a very weird result:
Instead of “You charged 0.20 Euros too much” it says “You charged 0.2999999999999999716 too much ”
As it is all a matter of adding or subtract amounts and nothing is divided or so these odd figures are very strange and we have no guess where the problem stems from.
(We have already considered a workaround using a java script that would round thw calculated difference to only two digits behind the decimal mark (decimal separator). But there must be another solution to this issue.
Any qualified suggestions will be very much appreciated.
Thanks in advance
Now available online