Showing posts with label Gold. Show all posts
Showing posts with label Gold. Show all posts
13 March 2015

Fix: Gold Comma Separators Scriptlet

In reference to the Gold Comma Separators Scriptlet, a bug was found. It was pointed out that in RMVXA, the commas worked fine in the main Gold Window, but opening up a shop and buying items resulted in a "Comparison of Fixnum with string failed" error.

And, since the previous method worked in RMXP and RMVX, but not in RMVXA, I was quite interested in finding a solution (not being one to shy away from a challenge), since I did overlook this in the first place.

Thanks to Dahcster for finding it and pointing it out.

17 February 2015

Gold Comma Separators Scriptlet

If, like me, you hate the way large numbers are displayed without any separators, thus making it hard to read, then you’ll want the Gold Comma Separators Scriptlet for your games.

What this does is separates large numbers with a comma every three blocks of numbers. Thus, 100000 becomes 100,000. That’s way easier to read! (Incidentally, it took me ages to figure out how to successfully do this!)

To achieve this, we attach

.to_s.reverse.gsub(/(\d{3})(?=\d)/, ‘\\1,’).reverse

to the $game_party.gold. This is done differently in each RPG Maker.

Edit: The RMVXA error has been fixed.

Related Posts with Thumbnails
Template Design "Perfect World" by SkinCorner