r/gamemaker • u/SkullnSkele • 18d ago
Resolved Point counter display 1K instead of 1000, without changing the real amount of points
I have a point counter and I want to shorten long numbers to 1K, 1T, etc. I've gotten some tips on that, but they involved dividing the real number by for example 1000, and then adding a K to the leftover number.
But I don't want the actual points to be changed, since they are being used to buy upgrades, I only want the numbers displayed to be shortened.
4
Upvotes
9
u/nickelangelo2009 Custom 18d ago
easy, get a second variable to keep track of the display string without changing the value of the actual counter variable
2
u/Krilantis 18d ago
Keep the score numeric and build a separate label: choose a scale and suffix by testing billions, millions, then thousands, and divide only for the displayed value. `string_format(shown, 1, 2)` gives exactly two decimal places; below 1000 you can use `string(global.dad_points)`. Declare a local `var display_counter` and then assign `global.display_counter = display_counter`, rather than using `var global.display_counter`.
0
u/Somnati 18d ago
i created a script that crunches numbers above 999 like that...if you add me on discord i can give it to you and show you how to use it