• grzes (unregistered)

    This is a simple function, it's strange that it took a few minutes to understand what it does.

  • Bo (unregistered)

    Guys... errmm.... I might we missing something, but why you use number as number, since it returns a string anyway? (Well, char in this case). If you got an input "1234567890", why it is bad to convert the thing to the string as it is and just break with commas, like "1,234,567,890" ?

  • too lazy to sign in now (unregistered) in reply to Bo
    Bo:
    Guys... errmm.... I might we missing something, but why you use number as *number*, since it returns a string anyway? (Well, char in this case). If you got an input "1234567890", why it is bad to convert the thing to the string as it is and just break with commas, like "1,234,567,890" ?
    'cause string manipulation is slow, complicated and bug-prone? Yes, in this case it's not too complicated and the speed is probably not very important, so doing it that way wouldn't constitute a WTF either, but the implemented algorithm is more elegant.

Leave a comment on “nice_num, mean_programmer”

Log In or post as a guest

Replying to comment #:

« Return to Article