Converting big numbers to prefixes

Example:
Score: 1000
And i want this to look like this
Score: 1K

And with millions ,billions, trillions etc.

I don’t know gdevelop good so please provide a screen or something

I did this in one of my games like this:

I did 1000 as K and 1000000 as M, but you could add 2 more steps for billions and trillions. The larger steps should come after smaller ones so that the largest one that applies

Howdy!
@Luxon5’s solution is decent, but I have qualms. Mostly with the use of “round”. Say you have 1500 points. Using round gives you a score of 2K points, which I’m may not be what you imagined. Use “trunc” instead, it just chops off the decimaly bits and leaves a nice whole number, so 1500 becomes 1k, and so do 1700, 1900 etc.
Also, using that solution would only allow whole numbers, and not, say, “1.5k”. If you’d like that, do something like this:
ToString(trunc(variable(score)/100)/10) + “k”.

Toodles!

3 Likes