From: Bil Kleb Date: 2007-05-07T10:35:09+09:00 Subject: Re: Inverse scanf: finding format specifers of existing fields Rick DeNatale wrote: > On 5/4/07, Bil Kleb wrote: >> assert_equal( '%8.7f', '.0001170'.to_number_format ) > > Not sure how this one worked, it fails for me. As a matter of fact: > irb(main):001:0> '%8.7f' % 0.0001170 > => "0.0001170" > > And I haven't been able to find an sprintf format string which > supresses a leading zero on a float. You're correct; as you wrote, I wasn't testing round-trip. Thanks, -- Bil Kleb http://fun3d.larc.nasa.gov