Forum Discussion
A Solution to rounding in Storyline – without using Javascript
Normal
0
false
false
false
oNotPromoteQF />
EN-US
X-NONE
X-NONE
I found a way to round numbers in Storyline without using Javascript. The challenge was to show whole percentage numbers from calculated decimal numbers (i.e. 33% for 1/3 and 67% for 2/3). Searching through the forums, all I could find was Javascript solutions and suggestions to submit a feature request. Not happy with either of these answers, I continued to play around.
I found that Storyline only holds 7 digits past the decimal place, and the 7th digit is rounded. So to get a rounded decimal (percentage) as a whole number, divide by 100,000, and then multiply by 10,000,000.
For example:
2 / 3 = 0.6666667 (rounded at the 7th position by Storyline)
0.6666667 / 100,000 = .000006666667 (which is rounded to 0.0000067)
0.0000067 * 10,000,000 = 67
Now we have our rounded 67% from 2/3
You should be able to apply this to any number you want to round. Divide and then multiply by a multiple of 10 that is large enough to push the number you want to round to the 7th position past the decimal (i.e. 13,567 / 10,000,000,000 * 10,000,000,000 = 14,000)
Hello everyone,
I have some great news to share! We just released another update for Storyline 360. In Update 112, we’ve included essential fixes and new features. One of the new features we’ve included is:
- Simplify reporting with a built-in option that rounds quiz scores to whole numbers.
Launch the Articulate 360 desktop app on your computer to take advantage of this update, and click the Update button next to Storyline 360. You’ll find our step-by-step instructions here.
Please let me know if you need additional help.
100 Replies
Hello everyone,
I have some great news to share! We just released another update for Storyline 360. In Update 112, we’ve included essential fixes and new features. One of the new features we’ve included is:
- Simplify reporting with a built-in option that rounds quiz scores to whole numbers.
Launch the Articulate 360 desktop app on your computer to take advantage of this update, and click the Update button next to Storyline 360. You’ll find our step-by-step instructions here.
Please let me know if you need additional help.
- JoelObrecht-033Community Member
Finally, I found that just hiding the decimals is easier to maintain. Not ideal, but works.
- JoelObrecht-033Community Member
It would be great if Storyline could add a rounding operator !!! For time calculations it is a must !!!
...
In my usecase, I used a rounding scale of triggers :
If RawVar > 1, affect 1 to RoundedVar
If RawVar > 2, affect 2 to RoundedVar
And so on...
In my case it's OK because it is a countdown timer using Project.Elapsed.Time divided by 60 000 and I wanted the time without funny decimals.
- JoelObrecht-033Community Member
Looks like the dividing trick doesn't work anymore ?
I've divided two times by the biggest number I can have and multiply it at the other end, and no rounding :(
- AlistairMontgomCommunity Member
Hi,
I don't know if this will help anyone now but I posted a question about progress bars that work forwards and backwards here - https://community.articulate.com/discussions/articulate-storyline/progress-bar-that-works-forwards-and-backwards#reply-832703
I was using Radosław Kwasek very cool trick from this post to get my rounded percentage and then apply that to a slider. However as some have pointed out here it only works moving forwards. I tried adding a "Set Rounded to 0" trigger as the first trigger on my master slide but that didn't work.Anyway the solution was simply to copy and paste that 'reset' trigger onto every slide. Now the slider progress bar and the percentage value update for each slide no matter what direction you go in!
Not sure why the trigger wasn't working on the master slide, possibly a bug? Anyway hope that can help someone else out!
- SharonBildst510Community Member
Thanks very much @Jennifer Barnett for posting the solution to change from %Results.scorePercent% to %Results.ScorePoints%. I just added an extra % to end of the string so the score can show as percent rather than points, and it worked perfectly and quickly! Now I can stop looking for a hidden textbox or state change or something that was causing the decimal point!
- MikeAdamskiCommunity Member
How about wanting to round a number that is not part of a quiz but just from a calculation of 2 variables? For instance, I have a variable that calculates to 4.67 and I'd like to round it to 4.7 without using JS in 360.
- ChristinaBrunoCommunity Member
I was able to use Mitch Hayashi's solution at the top of page 3 in Storyline 360. He provides a great screenshot there and it doesn't use Javascript or the multiply/divide option as offered on page 1 (which no longer works because 360 allows for infinite or near infinite decimal places now).
- RebeccaHay-03cbCommunity Member
Since so many of us need this option to display scores as whole numbers, why hasn't Articulate responded?
- MiguelRamosCommunity Member
Hi Radoslaw... I'm confused how that works, that's just adding 1 or subtracting 1. Thanks for sharing, big help.
- JeffForrerCommunity Member
Quite genius actually. It does add or subtract one, but does it while the condition is true. So in the add case, it adds one until the condition "rounded < original_score" is not true anymore. So in the case of 13.76, it keeps adding a whole number 14 times, to give you 14. If you change the "original_score" variable to any decimal number, you can see that value change.
- PamelaFunk-839cCommunity Member
I am not a numbers person at all. What if 13.76 is not the original score? The score changes depending on quiz takers answers.