Module: Jekyll::ThousandsSeparatedFilter

Defined in:
jekyll/_plugins/thousands-seperated-filter.rb

Instance Method Summary collapse

Instance Method Details

#thousands_separated(input, separator = ",") ⇒ Object



4
5
6
# File 'jekyll/_plugins/thousands-seperated-filter.rb', line 4

def thousands_separated(input, separator=",")
    input.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{separator}")
end