# Setting default number of decimal points on a variable

I'm using variables in a calculator-type situation.  Everything works fine, except when there's a '0' for the second decimal digit.  Example:  \$600.01 shows up as \$600.01; however \$600.10 shows up as \$600.1 (instead of \$600.10).    Is there anyway to make that second digit after the decimal point show up as a '0'?  Or some way to set a default number of digits to show after the decimal point?

###### 14 Replies

Sorry, Brenda. At this time, it seems that is how Storyline is designed to display a "0" in the hundredths spot of a decimal number, as it will always round up. Please feel free to submit a feature request

Because of this limitation, and how my boss likes "simple percents" I've had to come up with ways around this by using a state of an object to have % points for a grade and assigning variables to switch that object to the right % when the test is done grading. I'm going to send in a feature request too because this limitation causes a lot of extra work that seems unnecessary. If Storyline had a way to change the output of a number to be % and remove or add the decimal places, it'd make life a heck of a lot easier when coding this program. Not complaining, just well, okay, I'm complaining. Lol.

Drat Peter!  I was afraid of that.  Thanks for the response...I have submitted a feature request.

Our quiz results are showing up with decimals points... 66.6% when you get 3/5 - would like to just show 66 or 67% is there a way for this to be done?

Sorry, Susan. I still haven't seen a way to get that done on the results slide. Would love to see it, though

Was there ever a solution to this issue? I am facing the same problem.

I am trying to create a supermarket checkout scenario where the user scans objects in front of the scanner and the items appear on the till with the total amount at the bottom. The total amount is calculated using a variable but Storyline keeps removing the last zero after the decimal place.

Thanks Jesse for popping in to share that with Joanna Much appreciated.

Jesse Spinella said:

Here's how you can round up in Storyline. A co-worker of mine posted this a while back.

Jesse

Hi Jesse, Thanks for your reply, however I'm not trying to round up a percentage, I am trying to show the 0 after the decimal place.

For example, I want to add up the price of multiple shopping items but every time I get to a total of \$12.10 ... it will show as \$12.1

It keeps dropping the last 0 off the variable.

Is there a way in Storyline to keep the 2 decimal places, even when those digits are 0?

There is no way to keep two decimal points unless you use javascript triggers.

Hi Phil,

I realise this is an old post, but on the off chance you are still subscribed, are you able to briefly explain how you would do that using javascript triggers?

Thanks!

Hi Veronica,

In case Phil isn't subscribed to this thread, here's a sample that converts the StoryLine numerical variable into text (which will keep the decimal places) and sends that variable back to StoryLine.

Rona: thank you so much!

I will check this out. Cheers, Veronica