in reply to Re: Negative zero? There's gotta be a sprintf that undoes that, right?
in thread Negative zero? There's gotta be a sprintf that undoes that, right?

Oh, but it does...

perl -e 'printf "%.1f %.1f\n",0.05,0.049' 0.1 0.0
your method is good for truncating... course, with a suitable addition of .5 it rounds.

                - Ant
                - Some of my best work - (1 2 3)

  • Comment on Re^2: Negative zero? There's gotta be a sprintf that undoes that, right?
  • Download Code