I want to print out integer values like this:
puts "the value is #{x}" => the value is 1234567890
But I want to output to look like:
puts "the value is #{x}" => the value is 1,234,567,890 (or 1_234_567_890)
How do you do this?
I want to print out integer values like this:
puts "the value is #{x}" => the value is 1234567890
But I want to output to look like:
puts "the value is #{x}" => the value is 1,234,567,890 (or 1_234_567_890)
How do you do this?
1234567890.format # => "1,234,567,890"
1234567890.format(delimiter: '_') # => "1_234_567_890"