Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
RubyVM::YJIT.format_number_pct
format_number_pct(pad, number, total)
yjit.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/yjit.rb, line 484
def format_number_pct(pad, number, total)
padded_count = format_number(pad, number)
percentage = number.fdiv(total) * 100
formatted_pct = "%4.1f%%" % percentage
"#{padded_count} (#{formatted_pct})"
end
Format a number along with a percentage over a total value