String#% method allows to specify format that should be applied to its argument. It can be used to pad numbers with zeros.
String#%
> "%03d" % 2 => "002"
> "%.2f" % 2 => "2.00"