From: ts Date: 2001-10-31T22:25:34+09:00 Subject: [ruby-talk:23945] Re: strange string formating >>>>> "T" == Tomas Brixi writes: T> TK1000000104 0055.25 1234567 T> out = format( "%13s%04.2f", parts[0], part[1].to_f ) With "%04.2f" 4 give the length of the field, in your example you probably want a field length of 7, i.e. pigeon% /usr/bin/ruby -e 'puts format("%04.2f", 55.25)' 55.25 pigeon% pigeon% /usr/bin/ruby -e 'puts format("%07.2f", 55.25)' 0055.25 pigeon% Guy Decoux