module Latias::String
Public Instance Methods
add_commas(m_str)
click to toggle source
# File lib/latias-string-commas.rb, line 3 def add_commas(m_str) m_str.to_s.reverse.scan(/\d{3}|.+/).join(',').reverse rescue StandardError # optionally: `rescue Exception => ex` m_str end