数値のフォーマット
参考:
ActiveSupport::NumberHelper と ActionView::Helpers::NumberHelper の数値フォーマットメソッド | TechRacho
国際化 (I18n) API | Rails ガイド [公式]
ActiveSupport::NumericWithFormat | Ruby on Rails API [Official]
数字をカンマ区切りにする
require "active_support/core_ext/numeric/conversions" 123456789.to_s(:delimited) # => "123,456,789"
参考:
ruby / rails で数値を3桁区切りにする方法 – Qiita
format number with comma separators? | Just Skins
Is there a rails trick to adding commas to large numbers? – Stack Overflow
number_to_delimited – ActiveSupport::NumberHelper | Ruby on Rails API [Official]
number_with_delimiter – ActionView::Helpers::NumberHelper | Ruby on Rails API [Official]
ActiveSupport::NumericWithFormat
参考:
ActiveSupport::NumericWithFormat | Ruby on Rails API [Official]
rails/conversions.rb at v5.2.3 · rails/rails – GitHub
number_with_precision
参考:
number_with_precision | Railsドキュメント (railsdoc.com)
Using number_with_precision on controller in rails3 – Stack Overflow
number_with_precision For Prices – Stack Overflow
Helpers Outside Views (comments) – RailsCasts
number_with_precision – ActionView::Helpers::NumberHelper | Ruby on Rails API [Official]
number_with_precision formatting number with hyphens – Stack Overflow
number_to_currency
参考:
number_to_currency | Railsドキュメント (railsdoc.com)
number_to_currency – ActiveSupport::NumberHelper | Ruby on Rails API [Official]
number_to_currency – ActionView::Helpers::NumberHelper | Ruby on Rails API [Official]
number_to_human
参考:
number_to_human – ActiveSupport::NumberHelper | Ruby on Rails API [Official]
number_to_human – ActionView::Helpers::NumberHelper | Ruby on Rails API [Official]
number_to_human_size
参考:
number_to_human_size – ActiveSupport::NumberHelper | Ruby on Rails API [Official]
number_to_human_size – ActionView::Helpers::NumberHelper | Ruby on Rails API [Official]
Numeric
byte
/bytes
kilobyte
/kilobytes
megabyte
/megabytes
gigabyte
/gigabytes
terabyte
/terabytes
second
/seconds
minute
/minutes
hour
/hours
day
/days
week
/weeks
in_milliseconds
参考:
Numeric | Ruby on Rails API [Official]
Tips
参考: