Padding zeros in front of a number using String#rjust '12'.rjust(7,'0') #=> "0000012" ## Resources * String http://ruby-doc.org/core-2.3.0/String.html * Ruby: How to add zeros to front of a number string using sprintf() http://stackoverflow.com/questions/14077180/ruby-how-to-add-zeros-to-front-of-a-number-string-using-sprintf rjust string padding