Forum Discussion
TaylerMarshall-
5 months agoCommunity Member
Variable Formatting
Does anyone know how to change a variable style? I'm making a game using a count variable, and once my score gets above 1,000, the variable displays as 1000. I'd like to add the comma into the displ...
hey2ya
Community Member
Hi. Was this ever resolved?
TaylerMarshall-
2 months agoCommunity Member
Yes, the contact I received said it wasn't possible at this time.
- hey2ya2 months agoCommunity Member
Bummer. thank you! I tried searching the forum and didn't see what I was looking for. Chat GPT offered something, but I couldn't get it to work.
- SteveGannon2 months agoCommunity Member
See the simple example attached (read the JavaScript in the ExecuteJavascript trigger). As Walt indicated, you need to send the numeric variable to JavaScript, insert the commas, convert it to a string (text), and then send it back to Storyline and display it as a separate text variable.
(Note that this is a very old example. There are more modern ways of doing this in JavaScript nowadays but this old code still functions.)