puts '%6.4g' % 123.456 # ' 123.5': four significant digits in field six chars wide puts '%3s' % 'ruby' # 'ruby': string argument exceeds field width puts '%3.3s' % 'ruby' # 'rub': precision forces truncation of string