Piyush Ranjan's blogsite, Ruby, Ruby on Rails
10000.to_s.gsub(/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/, "\\1,")
super cool :)
Post a Comment
1 comments:
super cool :)
Post a Comment