Forum Discussion

MortenSrensen-a's avatar
MortenSrensen-a
Community Member
3 years ago

avoid storylne from rounding numbers with decimals

I have some variables with more than 2 decimals, (some times up to 14 decimals). My problem is, that Storyline keeps rounding the numbers to 2 decimals.

Eg. If I set this 'test' variable below to 0.349, Storyline changes it to 0.35. It happens both if I give it a default value when I create the variable or if I set the value of the variable in a trigger.

How can I avoid Storyline from rounding numbers with decimals?

  • When you create the variable, set it to text, rather than number.

    If you are using it for calculations, you will need to send it to Javascript to calculate, then return it to a text variable in SL.

    • EricSantos's avatar
      EricSantos
      Staff

      Hello Tim,

      I'm glad to see that Walt is helping you out. I'd like to chime in with the link to the article that outlines the steps to create a Storyline variable and how to choose the variable type.

       

      Please don't hesitate to reach out if you have additional questions.

  • Use text instead of numeric inputs in Storyline. Internally Storyline always rounds to 2 decimals. With text variables however you can use any amount of decimals.