æ°åã3æ¡ãã¤åºåã
é貨ã¿ãããªè¡¨ç¤º
1234567890.to_s.reverse.split(/(\d{3})/).select{|i|i.size>0}.join(',').reverse => "1,234,567,890"
1234567890.to_s.reverse.gsub(/(\d{3})/,'\1,').reverse => "1,234,567,890"
é貨ã¿ãããªè¡¨ç¤º
1234567890.to_s.reverse.split(/(\d{3})/).select{|i|i.size>0}.join(',').reverse => "1,234,567,890"
1234567890.to_s.reverse.gsub(/(\d{3})/,'\1,').reverse => "1,234,567,890"