0
0

More than 1 year has passed since last update.

Rubyで数値を3桁区切りにする方法

Last updated at Posted at 2022-03-11

Rubyで 1234567を1,234,567と出力したい。

require 'active_support'
require 'active_support/core_ext'
puts 1234567.to_s(:delimited) # 1,234,567

(requireは2つとも必要)

詳しくは
https://rip.hibariya.org/post/ruby-activesupport-to-s-args/
参照して下さい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0