in reply to Re: sprintf on floating point
in thread sprintf on floating point

perl -e 'print sprintf "%f", sprintf "%0.2f", 0.1' 0
However, you could do it this way (though without using sprintf):
perl -e 'print 0 + sprintf "%0.2f", 0.001' 0 perl -e 'print 0 + sprintf "%0.2f", 0.1234' 0.12
Does that help?

-- Dan

Replies are listed 'Best First'.
Re: Re: Re: sprintf on floating point
by Jaap (Curate) on Sep 05, 2002 at 14:30 UTC
    It does help however the first one doesn't work.