Blog Post
JodiSansone
Community Member
I just thought of something I would like to ask everyone--does anyone know an easy way to program for two decimal places in a number variable? I saw some threads on javascript solutions but I couldn't wrap my head around them.
Jonathan_Hill
2 years agoSuper Hero
I used Javascript to take the number from Storyline, write it to two decimal places, then return it to Storyline as a text variable.
This is because the number variable display defaults to 1 decimal place if the number ends in 0. So if the amount is 9.90, Storyline displays it as 9.9. It will only display as 9.90 if it's converted to text, as far as I know.
This is because the number variable display defaults to 1 decimal place if the number ends in 0. So if the amount is 9.90, Storyline displays it as 9.9. It will only display as 9.90 if it's converted to text, as far as I know.
- JodiSansone2 years agoCommunity MemberThanks for the explanation. I haven't been able to get the code to work so if I ever have to do this IRL I'll spend more time on it.