A way to add digit grouping to displayed variables?

ManaBrent

Veteran
Veteran
Joined
Apr 26, 2020
Messages
67
Reaction score
49
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,867
Reaction score
6,673
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
67
Reaction score
49
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

oneOfUs.jpg
Streaming more Poppet Quest game even in about 12 minutes.
Some dog owners really impress me. I'm pushing 2-3 metric tons of garbage containers that destroy everything they hit. What do you think is going to happen to your tiny dog when I run it over? And why are you crossing my path to argue with me? Have you never been hit by 200kgs of garbage?

Lesson for you folks. Never mess with an angry garbage container. Or its driver.
I didn't dispose of a file properly and now my whole game won't start: I get a script error in the Scene Manager stage of game launch. What to do? Transfer it all to a new project? That's going to be tedious. Fortunately I am only nine workdays into it.

Forum statistics

Threads
131,680
Messages
1,222,175
Members
173,427
Latest member
gkgk
Top