Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Global Gold Comma Separators Scriptlet - RMVXA
- # © 2015, Companion Wulf
- #------------------------------------------------------------------------------
- # Adds commas to larger numbers.
- #==============================================================================
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Constants to toggle commas on/off
- #--------------------------------------------------------------------------
- ENABLE_COMMAS = true # Enable/disable commas
- #--------------------------------------------------------------------------
- # * Convert to comma
- #--------------------------------------------------------------------------
- def to_comma(n)
- n.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
- end
- #--------------------------------------------------------------------------
- # * Draw Number (Gold Etc.) with Currency Unit
- #--------------------------------------------------------------------------
- alias :cwac_draw_curr_val :draw_currency_value
- def draw_currency_value(value, unit, x, y, width)
- value = to_comma(value) if ENABLE_COMMAS
- cwac_draw_curr_val(value, unit, x, y, width)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement