2020-01-24 Ruby sprintf sprintf はstring print formatの略 フォーマットを指定して文字列を返す時に使う。 sprintf(‘%0.3f’, 1.2)なら小数第3位まで数字を表示の意味だから、1.2は1.200