Menu

#35 sprintf "%10g"

Development Branch
open-later
nobody
1
2001-09-26
2001-04-27
No

Should pad to the left with zeroes, but pads with spaces.

Discussion

  • Chris Nandor

    Chris Nandor - 2001-04-27

    Logged In: YES
    user_id=3660

    OK, there were a few problems with sprintf. One is known in sfio: that is,
    that "%.0f", 0.6 should give 1, but gives 0. The other one is this one
    above. It seems sprintf is implemented in perl, except for with e/f/g, and
    that the local sprintf is used.

    So, first, we need to determine how much we care, and second, whether or
    not this can be fixed. Murr, you said you ported sfio 2000; maybe we can
    test with that? Or maybe you know something more about it? I am kinda
    scared about moving to sfio 2000 at this point (how much might break?),
    but maybe we can pull the sprintf code out if it is better now.

    Anyway, lemme know what you think, and if you have it, please send me
    your sfio 2000 port.

     
  • Chris Nandor

    Chris Nandor - 2001-04-27
    • summary: sprintf "%10g" --> sprintf "%10g"
    • assigned_to: pudge --> neeri
     
  • Matthias Neeracher

    Logged In: YES
    user_id=37219

    This should be sprintf "%010g". This does indeed not zero pad and it seems to be a logic error in sfio98. I'd suggest not fixing it for now and eventually migrating to sfio2000, which no longer has this bug.

     
  • Matthias Neeracher

    • summary: sprintf "%10g" --> sprintf "%10g"
    • assigned_to: neeri --> pudge
    • status: open --> open-later
     
  • Chris Nandor

    Chris Nandor - 2001-07-09
    • priority: 6 --> 3
    • summary: sprintf "%10g" --> sprintf "%10g"
     
  • Chris Nandor

    Chris Nandor - 2001-07-13
    • priority: 3 --> 1
    • summary: sprintf "%10g" --> sprintf "%10g"
     
  • Chris Nandor

    Chris Nandor - 2001-09-26
    • summary: sprintf "%10g" --> sprintf "%10g"
    • assigned_to: pudge --> nobody
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.