how to format floating point number

'%.2f' % 12.5 => "12.50"