Forum Discussion

TaylerMarshall-'s avatar
TaylerMarshall-
Community Member
3 months ago

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 displayed variable but I'm not sure how. Can anyone tell me how to change the displayed variable so that numbers include commas?  

  • You need to use Javascript to format it, then return it to SL in a text variable.  There are numberous examples here on the forum.

    • TaylerMarshall-'s avatar
      TaylerMarshall-
      Community Member

      Yes, the contact I received said it wasn't possible at this time. 

      • hey2ya's avatar
        hey2ya
        Community 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.

  • Hi Tayler, 

    Thanks so much for reaching out regarding your question surrounding variables! 

    Great call opening support case. One of our talented support engineers will be in touch shortly via email. Thanks for your patience. 

    We'll continue the conversation over in your case. 

    Have a wonderful start to your week!