A way to add digit grouping to displayed variables?

ManaBrent

Veteran
Veteran
Joined
Apr 26, 2020
Messages
66
Reaction score
47
First Language
English
Primarily Uses
RMMV
Is there a way to add digit grouping to variables displayed in text boxes?

For example making 1000000 display as 1,000,000.

I've found that I can make menu numbers display that way using Yanfly's Core Engine, but I'm at a loss how to make this happen in other areas.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,799
Reaction score
6,619
First Language
English
Primarily Uses
RMMV
JavaScript has a toLocaleString() method that adds comma grouping to numbers.

So you could do with event commands
Code:
Control Variables -> yourVariableWithANumber -> Script -> $gameVariables.value(thatVariablesId).toLocaleString()

Or if you're using a plugin that allows you to display evals in text, such as Yanfly's Message Eval Text, instead of using \V[34] to display the value of the variable you could do it directly: \evalText<<$gameVariables.value(34).toLocaleString()>>
 

ManaBrent

Veteran
Veteran
Joined
Apr 26, 2020
Messages
66
Reaction score
47
First Language
English
Primarily Uses
RMMV
That works perfectly! Thank you!

This is gonna take a while to edit in.
 

Latest Threads

Latest Profile Posts

I noticed they now have a Gremlins cartoon. Nothing like striking when the iron is hot then trying to make a reboot from a movie made 34 years ago.
Up to 40,000,000 people just became felons by bureaucratic decree today in the US. If you own certain configurations of plastic and velcro, best make sure you aren't risking 10 years behind bars. Just had to take back my mom's mothers day gift from three years ago. Fun times, thanks unelected bureaucrats.
Someone please post some beginner problems so I can act like I'm a veteran and know what I'm doing? (Also someone please stop @Andar and @ATT_Turan from posting on them because they are way too fast?!)
Random reminder to work on yo games! Good day.

Forum statistics

Threads
131,577
Messages
1,221,206
Members
173,277
Latest member
leonchan1117
Top