Percentage Calculations and Currency Dollars and Cents (decimal places)

Apr 12, 2018

I am trying to do a simple 'percent of cost = waste' calculation, and it seems that I must do extra steps for this simple math.  I have a percentage that is a decimal (33.4%), but cannot set the variable value to more than 2 significant digits after the decimal point (defaults to 0.33).  The same occurs if I type in '33.4%' as the default value.  I added an extra trigger to set the default value to 334 and another to divide by 1000.  That seems to get the math correct, but the variable value still shows as 0.33.  Then, the 'cost of waste' comes up with only one significant digit after the decimal point, where it should have 2 since it is currency.  I am surprised that SL360 does not have percentage or currency as a variable type?  Any suggestions to get this to show correctly.  I think I saw one that was java script, but I need to stay away from that if possible.  I've attached an example slide.

Thank you!

9 Replies
Michael Anselmo

Matney, Here is a link to 2 sides of my course showing that it works (I had to make sure this was the one. https://360.articulate.com/review/content/00ebb2bf-bef4-4f87-b92c-36375e97e2f0/review . I have attached the SL360 file and a text file with the script that I added in the trigger on the second slide of the course (2 slides total to demonstrate it).  I hope this is what you are looking for.  I I recall correctly, the script converts the number to text to allow it to show with 2 significant digits after the decimal place.  The variable that gets converted is one I call "costofwaste".  It is converted to "costofwastetext".  So, you have to create a new (text) variable so the script can set the value once converted.

This discussion is closed. You can start a new discussion or contact Articulate Support.