Score always be certain number of digits

Right now, my score variable displays in a text object and is just the amount of the variable. Is there a way to get this to display where it always has a specific number of digits, using zeros as a placeholder until the score gets higher? For example:

This: 0000500
Instead of: 500

I’ve tried several ways to do this but it’s all very clunky and just adds tons of code, so I was hoping someone had some insight as to the proper/best way to do this.

I can think of using a second sprite, like how LED scoreboards do it - the zeroes on the front are dimmed until it’s used, which is good, but if you’re not using an LED-styled font covering up the other non-zero numbers will be a nightmare. Maybe you can hide the zeroes from that second, dimmed sprite depending on how much digits you have? (That may also be complicated, nonetheless)

I ended up just doing the following:

Works great.

2 Likes

I have a similar issue but quite different. I don’t want to show decimal or anything after decimal. Or may be just two digits after decimal.
You can check out a short video of the issue from here: Troubleshooting Decimal Display Issue 👀 | Loom
I’d really appreciate help from the experts! :innocent: :pray:

Take a look at a better solution for the above issue here.

Also, I think your solution might be in the roundTo expression.

I tried all the solutions for the links you sent. None of them is working for me.

I got the solution for elsewhere! Thank you so much for your attention and time.