Add commas into score/number

  • I don't think it's a bug because if i change the Webstorage action back to how it was before it works the way it should do, the highscore updates when the score is beaten and stays that way until it's beaten again.

    Heres how the web action was before -

    Webstorage - Set local key "Highscore" to round(CurrentDistance)

    It's only when i change it to how it is in the picture above that the problem arises. So i think its a problem with how i've done it, but i'm not sure what i've done wrong. Do i have to do something different with the expression because i'm using Webstorage?

  • Don't save the formatted value. And change the event at line 8 (from your picture above) so you format the value from the LocalStorage. You have to store the decimal value, not a string representation.

    Be wary when you compare values, because "1000" is lesser than "200", but 1000 is greater than 200.

  • Thanks! That's fixed the problem

  • I have been using trultz example for currency (comma4). I don't have any idea how to make the commas work past trillions though. I'd like to get it to work until it hits scientific equations if possible. Anyone out there able to help me out please

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Magistross

    Does RegexReplace... work with Sprite Fonts?

    Thanx!

  • Does RegexReplace... work with Sprite Fonts?

    Of course it does. It's a text function, it works with anything string related.

  • Thank you Magistross, that was extremely insightful Capx. Impressive. Now that I understand this more, I can implement the regex and sprite font version. I ended up changing the per second to per tick which worked best for me in my scenario. Thanks again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)