[Solved]Need Help bug fix Coin Currency by Holy87

Hey guys, looking for smarter people than me to help fix this bug if possible.

Script works great, but, for some reason when I sell something the amount says - instead +. It does add up but it's not displayed properly, First time it shows nothing (+ or -) but after I move on other item or other window, it shows - like in the picture below. It adds 2 51 30 + 15= 2 51 45 but there is a minus instead of plus. Can you help out? It can be + or even nothing just to remove the bug.
NOTE: Don't mind the numbers going over the icons, it just a placement until/if the bug is fixed.

Spoiler: script
[TABLE]
[TR]
[TD]$imported = {} if $imported == nil[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]$imported["H87_Golds"] = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# COIN CURRENCY[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Author: Holy87[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Version: 1.2[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# User difficulty: ★[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# License: CC-BY. Everyone can distribute this script and use in their free[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# and commercial games. Credit required.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In many role-playing games like World of Warcraft and Dragon Age, the owned gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# is showed in bronze coins, silver coins and gold coins.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# This script will convert the gold from a simply number to a coin currency with[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# the relative icon.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# * Compatible with YEA Save Engine.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Instructions:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Copy the script under Materials and before the Main.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In a message, you can also convert a number in coins writing the \M[value][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# escape key.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Compatibility:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_currency_value -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# process_escape_character -> alias[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_item -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module H87_GoldSetup[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Insert the proper icons'ID:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONBRONZE = 140 #bronze coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONSILVER = 141 #silver coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONGOLD = 361 #gold coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #If you want, you can set different values for every value:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEBRONZE = 1 #1 bronze coin, don't change[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUESILVER = 100 #100 bronze coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEGOLD = 100 #100 silver coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Set this constant to true if you want that the digits will overlay a part of[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #the icon, saving space.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] IconOverlay = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module Vocab[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Text showed at the end of battle.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ObtainGold = "You've gained \\M[%s]!"[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** END OF CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Don't edit above if you don't know what you're doing.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Most of the necessary methods are in this class[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_Base < Window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] include H87_GoldSetup #module inclusion[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_currency_value override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_currency_value(value, unit, x, y, width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if value < 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] @negative = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value *= -1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 = width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONBRONZE,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(bronzes).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,bronzes,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONSILVER,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(silvers).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,silvers,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONGOLD,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(golds).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,golds,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 -= w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if @negative #draws a minus with negative numbers[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,"-",2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the bronze coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value%VALUESILVER[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the silver coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER%VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the gold coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER/VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * alias process_escape_character[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] alias goldp_e_c process_escape_character unless $@[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_escape_character(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] goldp_e_c(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] case code.upcase[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] when 'M'[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] process_draw_coins(obtain_escape_param(text),pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw the coins in the window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_draw_coins(value, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(value, "", pos[:x], pos[:y], width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] pos[:x] += width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * returns the text width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text = ""[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += bronzes.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += silvers.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += golds.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += text_size(text).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Edit to show coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_ShopBuy < Window_Selectable[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw item[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_item(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] item = @Data[index][/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect = item_rect(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_item_name(item, rect.x, rect.y, enable?(item))[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect.width -= 4[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(price(item),"",rect.x,rect.y,rect.width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_shopbuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]if $imported["YEA-SaveEngine"][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_FileStatus[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Override for Yanfy engine compatibility[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_FileStatus < Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_save_gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_save_gold(dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return if @header[😛arty].nil?[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] reset_font_settings[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(system_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(normal_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(@header[😛arty].gold.group.to_i, "", dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[/TABLE]

Untitled.png
Hey guys, looking for smarter people than me to help fix this bug if possible.

Script works great, but, for some reason when I sell something the amount says - instead +. It does add up but it's not displayed properly, First time it shows nothing (+ or -) but after I move on other item or other window, it shows - like in the picture below. It adds 2 51 30 + 15= 2 51 45 but there is a minus instead of plus. Can you help out? It can be + or even nothing just to remove the bug.
NOTE: Don't mind the numbers going over the icons, it just a placement until/if the bug is fixed.

Spoiler: script
[TABLE]
[TR]
[TD]$imported = {} if $imported == nil[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]$imported["H87_Golds"] = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# COIN CURRENCY[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Author: Holy87[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Version: 1.2[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# User difficulty: ★[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# License: CC-BY. Everyone can distribute this script and use in their free[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# and commercial games. Credit required.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In many role-playing games like World of Warcraft and Dragon Age, the owned gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# is showed in bronze coins, silver coins and gold coins.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# This script will convert the gold from a simply number to a coin currency with[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# the relative icon.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# * Compatible with YEA Save Engine.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Instructions:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Copy the script under Materials and before the Main.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In a message, you can also convert a number in coins writing the \M[value][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# escape key.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Compatibility:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_currency_value -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# process_escape_character -> alias[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_item -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module H87_GoldSetup[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Insert the proper icons'ID:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONBRONZE = 140 #bronze coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONSILVER = 141 #silver coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONGOLD = 361 #gold coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #If you want, you can set different values for every value:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEBRONZE = 1 #1 bronze coin, don't change[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUESILVER = 100 #100 bronze coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEGOLD = 100 #100 silver coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Set this constant to true if you want that the digits will overlay a part of[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #the icon, saving space.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] IconOverlay = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module Vocab[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Text showed at the end of battle.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ObtainGold = "You've gained \\M[%s]!"[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** END OF CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Don't edit above if you don't know what you're doing.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Most of the necessary methods are in this class[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_Base < Window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] include H87_GoldSetup #module inclusion[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_currency_value override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_currency_value(value, unit, x, y, width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if value < 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] @negative = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value *= -1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 = width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONBRONZE,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(bronzes).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,bronzes,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONSILVER,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(silvers).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,silvers,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONGOLD,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(golds).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,golds,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 -= w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if @negative #draws a minus with negative numbers[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,"-",2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the bronze coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value%VALUESILVER[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the silver coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER%VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the gold coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER/VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * alias process_escape_character[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] alias goldp_e_c process_escape_character unless $@[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_escape_character(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] goldp_e_c(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] case code.upcase[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] when 'M'[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] process_draw_coins(obtain_escape_param(text),pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw the coins in the window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_draw_coins(value, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(value, "", pos[:x], pos[:y], width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] pos[:x] += width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * returns the text width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text = ""[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += bronzes.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += silvers.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += golds.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += text_size(text).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Edit to show coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_ShopBuy < Window_Selectable[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw item[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_item(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] item = @Data[index][/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect = item_rect(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_item_name(item, rect.x, rect.y, enable?(item))[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect.width -= 4[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(price(item),"",rect.x,rect.y,rect.width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_shopbuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]if $imported["YEA-SaveEngine"][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_FileStatus[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Override for Yanfy engine compatibility[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_FileStatus < Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_save_gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_save_gold(dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return if @header[😛arty].nil?[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] reset_font_settings[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(system_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(normal_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(@header[😛arty].gold.group.to_i, "", dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[/TABLE]

View attachment 224648
Please re-up your script, some of its lines turn to smiley face, or give me the name of the script.
Spoiler: Holy87 Coin Currency
Ruby:
$imported = {} if $imported == nil
$imported["H87_Golds"] = true
#===============================================================================
# COIN CURRENCY
#===============================================================================
# Author: Holy87
# Version: 1.2
# User difficulty: ★
# License: CC-BY. Everyone can distribute this script and use in their free
# and commercial games. Credit required.
#-------------------------------------------------------------------------------
# In many role-playing games like World of Warcraft and Dragon Age, the owned gold
# is showed in bronze coins, silver coins and gold coins.
# This script will convert the gold from a simply number to a coin currency with
# the relative icon.
# * Compatible with YEA Save Engine.
#-------------------------------------------------------------------------------
# Instructions:
# Copy the script under Materials and before the Main.
# In a message, you can also convert a number in coins writing the \M[value]
# escape key.
#-------------------------------------------------------------------------------
# Compatibility:
# Window_Base
#   draw_currency_value       -> override
#   process_escape_character  -> alias
# Window_ShopBuy
#   draw_item                 -> override
#-------------------------------------------------------------------------------
module H87_GoldSetup
 
#===============================================================================
# ** CONFIGURATION **
#===============================================================================
  #Insert the proper icons'ID:
  ICONBRONZE = 140  #bronze coin icon
  ICONSILVER = 141  #silver coin icon
  ICONGOLD   = 361  #gold coin icon
 
  #If you want, you can set different values for every value:
  VALUEBRONZE = 1     #1 bronze coin, don't change
  VALUESILVER = 100   #100 bronze coins
  VALUEGOLD   = 100   #100 silver coins
 
  #Set this constant to true if you want that the digits will overlay a part of
  #the icon, saving space.
  IconOverlay = true
end

module Vocab
  #Text showed at the end of battle.
  ObtainGold      = "You've gained \\M[%s]!"
end


#===============================================================================
# ** END OF CONFIGURATION **
# Don't edit above if you don't know what you're doing.
#===============================================================================



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Most of the necessary methods are in this class
#==============================================================================
class Window_Base < Window
  include H87_GoldSetup #module inclusion
  #--------------------------------------------------------------------------
  # * draw_currency_value override
  #--------------------------------------------------------------------------
  def draw_currency_value(value, unit, x, y, width)
    if value < 0
      @negative = true
      value *= -1
    end
    iconw = IconOverlay ? 12 : 24
    bronzes = get_bronzes(value)
    silvers = get_silvers(value)
    golds   = get_golds(value)
    w2 = width
    if bronzes > 0
      draw_icon(ICONBRONZE,x+w2-24,y)
      w2-=iconw
      w1 = text_size(bronzes).width
      draw_text(x,y,w2,line_height,bronzes,2)
      w2-=w1
    end
    if silvers > 0
      draw_icon(ICONSILVER,x+w2-24,y)
      w2-=iconw
      w1 = text_size(silvers).width
      draw_text(x,y,w2,line_height,silvers,2)
      w2-=w1
    end
    if golds > 0
      draw_icon(ICONGOLD,x+w2-24,y)
      w2-=iconw
      w1 = text_size(golds).width
      draw_text(x,y,w2,line_height,golds,2)
      w2 -= w1
    end
    if @negative #draws a minus with negative numbers
      draw_text(x,y,w2,line_height,"-",2)
    end
  end
  #--------------------------------------------------------------------------
  # * Returns the bronze coins from value
  #--------------------------------------------------------------------------
  def get_bronzes(value)
    value%VALUESILVER
  end
  #--------------------------------------------------------------------------
  # * Returns the silver coins from value
  #--------------------------------------------------------------------------
  def get_silvers(value)
    value/VALUESILVER%VALUEGOLD
  end
  #--------------------------------------------------------------------------
  # * Returns the gold coins from value
  #--------------------------------------------------------------------------
  def get_golds(value)
    value/VALUESILVER/VALUEGOLD
  end
  #--------------------------------------------------------------------------
  # * alias process_escape_character
  #--------------------------------------------------------------------------
  alias goldp_e_c process_escape_character unless $@
  def process_escape_character(code, text, pos)
    goldp_e_c(code, text, pos)
    case code.upcase
    when 'M'
      process_draw_coins(obtain_escape_param(text),pos)
    end
  end
  #--------------------------------------------------------------------------
  # * draw the coins in the window
  #--------------------------------------------------------------------------
  def process_draw_coins(value, pos)
    width = calc_currency_width(value)
    draw_currency_value(value, "", pos[:x], pos[:y], width)
    pos[:x] += width
  end
  #--------------------------------------------------------------------------
  # * returns the text width
  #--------------------------------------------------------------------------
  def calc_currency_width(value)
    iconw = IconOverlay ? 12 : 24
    bronzes = get_bronzes(value)
    silvers = get_silvers(value)
    golds   = get_golds(value)
    text = ""
    width = 0
    if bronzes > 0
      text += bronzes.to_s
      width += iconw
    end
    if silvers > 0
      text += silvers.to_s
      width += iconw
    end
    if golds > 0
      text += golds.to_s
      width += iconw
    end
    width += text_size(text).width
    return width
  end
end #window_base

#==============================================================================
# ** Window_ShopBuy
#------------------------------------------------------------------------------
#  Edit to show coins
#==============================================================================
class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # * draw item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item))
    rect.width -= 4
    draw_currency_value(price(item),"",rect.x,rect.y,rect.width)
  end
end #window_shopbuy

if $imported["YEA-SaveEngine"]
#==============================================================================
# ** Window_FileStatus
#------------------------------------------------------------------------------
#  Override for Yanfy engine compatibility
#==============================================================================
class Window_FileStatus < Window_Base
  #--------------------------------------------------------------------------
  # * draw_save_gold
  #--------------------------------------------------------------------------
  def draw_save_gold(dx, dy, dw)
    return if @header[:party].nil?
    reset_font_settings
    change_color(system_color)
    draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
    change_color(normal_color)
    draw_currency_value(@header[:party].gold.group.to_i, "", dx, dy, dw)
  end
end
end
This is the proper script. No idea what you have there.
Hey guys, looking for smarter people than me to help fix this bug if possible.

Script works great, but, for some reason when I sell something the amount says - instead +. It does add up but it's not displayed properly, First time it shows nothing (+ or -) but after I move on other item or other window, it shows - like in the picture below. It adds 2 51 30 + 15= 2 51 45 but there is a minus instead of plus. Can you help out? It can be + or even nothing just to remove the bug.
NOTE: Don't mind the numbers going over the icons, it just a placement until/if the bug is fixed.

Spoiler: script
[TABLE]
[TR]
[TD]$imported = {} if $imported == nil[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]$imported["H87_Golds"] = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# COIN CURRENCY[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Author: Holy87[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Version: 1.2[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# User difficulty: ★[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# License: CC-BY. Everyone can distribute this script and use in their free[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# and commercial games. Credit required.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In many role-playing games like World of Warcraft and Dragon Age, the owned gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# is showed in bronze coins, silver coins and gold coins.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# This script will convert the gold from a simply number to a coin currency with[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# the relative icon.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# * Compatible with YEA Save Engine.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Instructions:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Copy the script under Materials and before the Main.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# In a message, you can also convert a number in coins writing the \M[value][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# escape key.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Compatibility:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_currency_value -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# process_escape_character -> alias[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# draw_item -> override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#-------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module H87_GoldSetup[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Insert the proper icons'ID:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONBRONZE = 140 #bronze coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONSILVER = 141 #silver coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ICONGOLD = 361 #gold coin icon[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #If you want, you can set different values for every value:[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEBRONZE = 1 #1 bronze coin, don't change[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUESILVER = 100 #100 bronze coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] VALUEGOLD = 100 #100 silver coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] [/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Set this constant to true if you want that the digits will overlay a part of[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #the icon, saving space.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] IconOverlay = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]module Vocab[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #Text showed at the end of battle.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] ObtainGold = "You've gained \\M[%s]!"[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** END OF CONFIGURATION **[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Don't edit above if you don't know what you're doing.[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#===============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Most of the necessary methods are in this class[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_Base < Window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] include H87_GoldSetup #module inclusion[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_currency_value override[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_currency_value(value, unit, x, y, width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if value < 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] @negative = true[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value *= -1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 = width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONBRONZE,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(bronzes).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,bronzes,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONSILVER,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(silvers).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,silvers,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_icon(ICONGOLD,x+w2-24,y)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2-=iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w1 = text_size(golds).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,golds,2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] w2 -= w1[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if @negative #draws a minus with negative numbers[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(x,y,w2,line_height,"-",2)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the bronze coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value%VALUESILVER[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the silver coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER%VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * Returns the gold coins from value[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] value/VALUESILVER/VALUEGOLD[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * alias process_escape_character[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] alias goldp_e_c process_escape_character unless $@[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_escape_character(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] goldp_e_c(code, text, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] case code.upcase[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] when 'M'[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] process_draw_coins(obtain_escape_param(text),pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw the coins in the window[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def process_draw_coins(value, pos)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(value, "", pos[:x], pos[:y], width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] pos[:x] += width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * returns the text width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def calc_currency_width(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] iconw = IconOverlay ? 12 : 24[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] bronzes = get_bronzes(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] silvers = get_silvers(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] golds = get_golds(value)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text = ""[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width = 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if bronzes > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += bronzes.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if silvers > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += silvers.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] if golds > 0[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] text += golds.to_s[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += iconw[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] width += text_size(text).width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return width[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_ShopBuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Edit to show coins[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_ShopBuy < Window_Selectable[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw item[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_item(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] item = @Data[index][/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect = item_rect(index)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_item_name(item, rect.x, rect.y, enable?(item))[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] rect.width -= 4[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(price(item),"",rect.x,rect.y,rect.width)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end #window_shopbuy[/TD]
[/TR]
[TR]
[TD][/TD]

[TD][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]if $imported["YEA-SaveEngine"][/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# ** Window_FileStatus[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#------------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]# Override for Yanfy engine compatibility[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]#==============================================================================[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]class Window_FileStatus < Window_Base[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] # * draw_save_gold[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] #--------------------------------------------------------------------------[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] def draw_save_gold(dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] return if @header[😛arty].nil?[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] reset_font_settings[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(system_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] change_color(normal_color)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] draw_currency_value(@header[😛arty].gold.group.to_i, "", dx, dy, dw)[/TD]
[/TR]
[TR]
[TD][/TD]

[TD] end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[TR]
[TD][/TD]

[TD]end[/TD]
[/TR]
[/TABLE]

View attachment 224648
Spoiler: Holy87 Coin Currency
Ruby:
$imported = {} if $imported == nil
$imported["H87_Golds"] = true
#===============================================================================
# COIN CURRENCY
#===============================================================================
# Author: Holy87
# Version: 1.2
# User difficulty: ★
# License: CC-BY. Everyone can distribute this script and use in their free
# and commercial games. Credit required.
#-------------------------------------------------------------------------------
# In many role-playing games like World of Warcraft and Dragon Age, the owned gold
# is showed in bronze coins, silver coins and gold coins.
# This script will convert the gold from a simply number to a coin currency with
# the relative icon.
# * Compatible with YEA Save Engine.
#-------------------------------------------------------------------------------
# Instructions:
# Copy the script under Materials and before the Main.
# In a message, you can also convert a number in coins writing the \M[value]
# escape key.
#-------------------------------------------------------------------------------
# Compatibility:
# Window_Base
#   draw_currency_value       -> override
#   process_escape_character  -> alias
# Window_ShopBuy
#   draw_item                 -> override
#-------------------------------------------------------------------------------
module H87_GoldSetup
 
#===============================================================================
# ** CONFIGURATION **
#===============================================================================
  #Insert the proper icons'ID:
  ICONBRONZE = 140  #bronze coin icon
  ICONSILVER = 141  #silver coin icon
  ICONGOLD   = 361  #gold coin icon
 
  #If you want, you can set different values for every value:
  VALUEBRONZE = 1     #1 bronze coin, don't change
  VALUESILVER = 100   #100 bronze coins
  VALUEGOLD   = 100   #100 silver coins
 
  #Set this constant to true if you want that the digits will overlay a part of
  #the icon, saving space.
  IconOverlay = true
end

module Vocab
  #Text showed at the end of battle.
  ObtainGold      = "You've gained \\M[%s]!"
end


#===============================================================================
# ** END OF CONFIGURATION **
# Don't edit above if you don't know what you're doing.
#===============================================================================



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Most of the necessary methods are in this class
#==============================================================================
class Window_Base < Window
  include H87_GoldSetup #module inclusion
  #--------------------------------------------------------------------------
  # * draw_currency_value override
  #--------------------------------------------------------------------------
  def draw_currency_value(value, unit, x, y, width)
    if value < 0
      @negative = true
      value *= -1
    end
    iconw = IconOverlay ? 12 : 24
    bronzes = get_bronzes(value)
    silvers = get_silvers(value)
    golds   = get_golds(value)
    w2 = width
    if bronzes > 0
      draw_icon(ICONBRONZE,x+w2-24,y)
      w2-=iconw
      w1 = text_size(bronzes).width
      draw_text(x,y,w2,line_height,bronzes,2)
      w2-=w1
    end
    if silvers > 0
      draw_icon(ICONSILVER,x+w2-24,y)
      w2-=iconw
      w1 = text_size(silvers).width
      draw_text(x,y,w2,line_height,silvers,2)
      w2-=w1
    end
    if golds > 0
      draw_icon(ICONGOLD,x+w2-24,y)
      w2-=iconw
      w1 = text_size(golds).width
      draw_text(x,y,w2,line_height,golds,2)
      w2 -= w1
    end
    if @negative #draws a minus with negative numbers
      draw_text(x,y,w2,line_height,"-",2)
    end
  end
  #--------------------------------------------------------------------------
  # * Returns the bronze coins from value
  #--------------------------------------------------------------------------
  def get_bronzes(value)
    value%VALUESILVER
  end
  #--------------------------------------------------------------------------
  # * Returns the silver coins from value
  #--------------------------------------------------------------------------
  def get_silvers(value)
    value/VALUESILVER%VALUEGOLD
  end
  #--------------------------------------------------------------------------
  # * Returns the gold coins from value
  #--------------------------------------------------------------------------
  def get_golds(value)
    value/VALUESILVER/VALUEGOLD
  end
  #--------------------------------------------------------------------------
  # * alias process_escape_character
  #--------------------------------------------------------------------------
  alias goldp_e_c process_escape_character unless $@
  def process_escape_character(code, text, pos)
    goldp_e_c(code, text, pos)
    case code.upcase
    when 'M'
      process_draw_coins(obtain_escape_param(text),pos)
    end
  end
  #--------------------------------------------------------------------------
  # * draw the coins in the window
  #--------------------------------------------------------------------------
  def process_draw_coins(value, pos)
    width = calc_currency_width(value)
    draw_currency_value(value, "", pos[:x], pos[:y], width)
    pos[:x] += width
  end
  #--------------------------------------------------------------------------
  # * returns the text width
  #--------------------------------------------------------------------------
  def calc_currency_width(value)
    iconw = IconOverlay ? 12 : 24
    bronzes = get_bronzes(value)
    silvers = get_silvers(value)
    golds   = get_golds(value)
    text = ""
    width = 0
    if bronzes > 0
      text += bronzes.to_s
      width += iconw
    end
    if silvers > 0
      text += silvers.to_s
      width += iconw
    end
    if golds > 0
      text += golds.to_s
      width += iconw
    end
    width += text_size(text).width
    return width
  end
end #window_base

#==============================================================================
# ** Window_ShopBuy
#------------------------------------------------------------------------------
#  Edit to show coins
#==============================================================================
class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # * draw item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item))
    rect.width -= 4
    draw_currency_value(price(item),"",rect.x,rect.y,rect.width)
  end
end #window_shopbuy

if $imported["YEA-SaveEngine"]
#==============================================================================
# ** Window_FileStatus
#------------------------------------------------------------------------------
#  Override for Yanfy engine compatibility
#==============================================================================
class Window_FileStatus < Window_Base
  #--------------------------------------------------------------------------
  # * draw_save_gold
  #--------------------------------------------------------------------------
  def draw_save_gold(dx, dy, dw)
    return if @header[:party].nil?
    reset_font_settings
    change_color(system_color)
    draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
    change_color(normal_color)
    draw_currency_value(@header[:party].gold.group.to_i, "", dx, dy, dw)
  end
end
end
This is the proper script. No idea what you have there.
I will find way to fix this. Thanks
Hey guys, I've just come from first job, I saw that there was some issue with the script I pasted, duno what happened, I've taken it from Holy's site.

I guess you have now proper script anyway, so I won't paste it again. Thanks @Roninator2
Figured out the issue. The negative needs to be set to false before it checks the value.
add in @negative = false
in this part
Ruby:
class Window_Base < Window
  include H87_GoldSetup #module inclusion
  #--------------------------------------------------------------------------
  # * draw_currency_value override
  #--------------------------------------------------------------------------
  def draw_currency_value(value, unit, x, y, width)
    @negative = false
    if value < 0
      @negative = true
      value *= -1
    end
Works perfect! Thanks @Roninator2
Also, I didn't know I already posted it, must have been while I was bussy durring job and forgot about it
Figured out the issue. The negative needs to be set to false before it checks the value.
add in @negative = false
in this part
Ruby:
class Window_Base < Window
  include H87_GoldSetup #module inclusion
  #--------------------------------------------------------------------------
  # * draw_currency_value override
  #--------------------------------------------------------------------------
  def draw_currency_value(value, unit, x, y, width)
    @negative = false
    if value < 0
      @negative = true
      value *= -1
    end
Thank you @Roninator2 , I have updated the script with this fix 👋

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-need-help-bug-fix-coin-currency-by-holy87.147173/