[Please Delete, I Posted it in the wrong forum thanks.]

Edit: [ I might have posted this, in the wrong forum sorry if I did]

I've tried:
$dataSystem.Gold;
$gameParty.gold();

I use a Paid tool to create menus https://srdude.itch.io/hud-maker-ultra-pro, and it allows me to display \V and other code. It allows me to call the gold value, but not Format it.

So I am trying to display the players money, in a Text but it always puts it into one set. I need it to put a , or . in the value.
need it to Format it like $1,356.18, not like 135610.

I do have VisuStella MZ Core Plugin installed VisuMZ_0_CoreEngine.js, and it auto does this for me in all the menus. But when I call it in text it don't format it. Not sure how to call that plugins command to display it so.

I did find a post under Gold, about doing this but I can't get it to work properly.
So I tried searching for a way to display it.
Code:
$gameParty.gold();
I'm sure because it's not calling the right value. It's empty.
According to: https://rpgmaker.net/tutorials/43/
Commands:

\C[n] Show a text color. n=a number(1 to 19)
\S[n] Set the text speed. n=a number(1 to 20) 1 is the fastest(without pauses) and 20 is the slowest.
\N[n] Show the name of a hero. n=hero's number.Note that 0 will write the name of your party's leader.
\V[n] Show a variable value. n=variable's number.
\$ A box appears showing your current money.
\! Put that before a word. You will have to press enter to show that word but it will be in the same box than the others.
\. 1/4 of delay before the next letter.
\| 1 delay before the next letter.
\^ The message end without you need to press enter.
\> \< Displays the part of the message between \> and \< instantly.
\\ Shows "\".
\_ Shows half a space.
There is no command to just show \Gold without a window?
I did find a post under Gold, about doing this but I can't get it to work properly.
Code:
return parseFloat(Math.round(this._gold * 100) / 100).toFixed(2);
I'm sure because it's not calling the right value.

Did you store the result of that script in a variable and tried to display that variable in text using $\v[n]?

By the way, your script only rounds your number to 2 digits after the decimal point. It doesn't add the thousands-separator. If you need a comma (,) as thousands-separator, consider using toLocaleString("en") instead.

Since you said you expect your number to be formatted like $1,356.18, your complete script would be:
JavaScript:
$gameParty._gold.toLocaleString("en", { style: "currency", currency: "USD" })
This will turn 12345 to $12,345.00 and 12345.6789 to $12,345.68.

If you need a custom currency format, I'd recommend not using the currency style in the first place, and instead specify the number of decimal digits you want, like this:
JavaScript:
$gameParty._gold.toLocaleString("en", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
This will ensure the number always has exactly 2 decimal digits.



A few remarks about the code you found:

The parseFloat() function is superfluous, because you're not giving it a string (text) and because $gameParty._gold is guaranteed to be a number anyway. The purpose of parseFloat() is to turn strings (text) into numbers. Without strings, there's nothing to parse.

I recommend using $gameParty._gold instead of this._gold, because this._gold only works if this is in the context of the $gameParty, which it probably won't be (I'd need to test this, but why test something you're not sure about, if there's a perfectly good alternative you can be sure about?)

Math.round() is superfluous, because both toFixed() and toLocaleString() already perform rounding anyway.

The toFixed() function is superfluous because it returns a string (text), so toLocaleString() wouldn't work afterwards, since it expects a number instead.
Did you store the result of that script in a variable and tried to display that variable in text using $\v[n]?

By the way, your script only rounds your number to 2 digits after the decimal point. It doesn't add the thousands-separator. If you need a comma (,) as thousands-separator, consider using toLocaleString("en") instead.

Since you said you expect your number to be formatted like $1,356.18, your complete script would be:
JavaScript:
$gameParty._gold.toLocaleString("en", { style: "currency", currency: "USD" })
This will turn 12345 to $12,345.00 and 12345.6789 to $12,345.68.

If you need a custom currency format, I'd recommend not using the currency style in the first place, and instead specify the number of decimal digits you want, like this:
JavaScript:
$gameParty._gold.toLocaleString("en", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
This will ensure the number always has exactly 2 decimal digits.



A few remarks about the code you found:

The parseFloat() function is superfluous, because you're not giving it a string (text) and because $gameParty._gold is guaranteed to be a number anyway. The purpose of parseFloat() is to turn strings (text) into numbers. Without strings, there's nothing to parse.

I recommend using $gameParty._gold instead of this._gold, because this._gold only works if this is in the context of the $gameParty, which it probably won't be (I'd need to test this, but why test something you're not sure about, if there's a perfectly good alternative you can be sure about?)

Math.round() is superfluous, because both toFixed() and toLocaleString() already perform rounding anyway.

The toFixed() function is superfluous because it returns a string (text), so toLocaleString() wouldn't work afterwards, since it expects a number instead.
I just tried the:
$gameParty._gold.toLocaleString("en", { style: "currency", currency: "USD" })
but nothing shows up. Is there something I need to do to get it to show up?
Or am I not understanding how to do this, I am a when it comes to this stuff. That's why I always save the command so I can reference them once they work. Do I need to ad a to string to it.

HUD-Maker-Pro.png
Your event would look like this:
Screenshot 2021-08-10 215730.png


And in the game you'd get this:
Screenshot 2021-08-10 215803.png


Note that the n in \v[n] must match the ID of the variable you're using to store the evaluation of your script. In my case, since I'm using variable #0001, n is 1, and thus I need \v[1].

IMPORTANT: Make sure you don't prepend zeroes in front of your number, so use \v[1] and not \v[0001], or else you could have some weird side effects. Like \v[0010] displaying the content of variable #0008 instead of #0010, for example.
Your event would look like this:
View attachment 198297

And in the game you'd get this:
View attachment 198298

Note that the n in \v[n] must match the ID of the variable you're using to store the evaluation of your script. In my case, since I'm using variable #0001, n is 1, and thus I need \v[1].
I added an image tp my last post, I need to call and format the vale in text. But in a custom menu.
Not stored in a Variable. like a normal call for gold, but formatted to add the , and .
It was my fault for not being more clear on what I am trying to do.

Edit 501 lol.
Like

[Text" Player Money: $156782]

but formatted as

[Text" Player Money: $1,567.82]

In like a normal display text. And in a script call?
Or should it be in a js file, and I call it from there like function(); in the code?
Edit: Or like how some tools like php have a format call you can reference, to format a value?
It probable don't have that, but something that can separate the output of the values.
I understand now. I'm sorry to say that I can't help in this case, since I don't know the plugin. I hope someone else can help.
I understand now. I'm sorry to say that I can't help in this case, since I don't know the plugin. I hope someone else can help.
Well the plugin that does it for me is.

I just not sure how to call the code to show it through that. So that's why I'm trying to just display it.
You would thing MZ being expensive, it would have an option under system1 to change from G to $ format easily.

Did you store the result of that script in a variable and tried to display that variable in text using $\v[n]?
If you need a custom currency format, I'd recommend not using the currency style in the first place, and instead specify the number of decimal digits you want, like this:
JavaScript:
$gameParty._gold.toLocaleString("en", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
This will ensure the number always has exactly 2 decimal digits.
Is it possible to use the above, to to store the converted value to a Var, then I guess I could just call that?
Edit: Ok thanks to your info on the above.
I was able to store the value formatted. Then I just called it using \V[28] and it works.
I'll just have to add that new update to each one. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/please-delete-i-posted-it-in-the-wrong-forum-thanks.139454/