Forum Discussion
Formatting for Number Variables
Hi!
I'm designing a math course in Storyline 360 that has a "try it" section where learners input numbers into a formula and click "calculate" to see the result. I've got the functionality working. However, I want the answers to display as a percentage.
Is there a way to format a number variable so that it displays as a percentage (example: 43%) instead of a decimal (0.43)?
I've attached a screenshot of how the answer is currently displaying.
Thanks,
Erin
- WaltHamiltonSuper Hero
If you need to keep the original answer for some other purpose, create a new variable (e.g. displayTotal). Then create triggers to:
set displayTotal = variable Total
Multiply displayTotal by value 100
Enter reference to displayTotal in text box, followed by percentage sign.
Doing this will leave you with decimal values if the original operation has more than two digits. You cannot format those numbers to whole numbers, unless you execute a javascript. Then the value is returned as a text, so must first be multiplied and rounded, then returned to a text variable to display.
- ErinFrank-45d81Community Member
Thank you!!! Exactly what I needed. :)
- WaltHamiltonSuper HeroYou're welcome. PIAWYC (Pass it along when you can).