Created
August 16, 2012 14:38
-
-
Save sinsoku/3370590 to your computer and use it in GitHub Desktop.
gruff patch for ruby 1.9.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/gruff/base.rb | |
module Gruff | |
class Base | |
def label_with_ruby193(value) | |
if @marker_count.to_f == 0 | |
label = value.to_i.to_s | |
parts = label.split('.') | |
parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{THOUSAND_SEPARATOR}") | |
parts.join('.') | |
else | |
label_without_ruby193(value) | |
end | |
end | |
alias_method_chain :label, :ruby193 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment