• (nodebb)

    I've written versions of formatNumberWithCommas in different environments(1), but I've never had the urge to format the part after the decimal point.

    (1) Including one that (theoretically) takes into account the full gamut of commafication that can be expressed in the Windows locale APIs.(2) That was ... painful.

    (2) It's capable of expressing simple stuff like traditional Indian lakhs and crores, all the way up to as elaborate as you'd like.

  • (nodebb)

    Now we know how Python achieved its very undeserved popularity.

  • my name is missing (unregistered)

    People who use floating point to represent money should receive 38.9999999999999999995959493 lashes.

  • kaewberg (unregistered)

    Shouldn't the thousandth separators work left to right?

  • ZPedro (unregistered)

    Darn it, any handling of money as floating-point numbers is a red flag, but for a budget making app it ought to be a death call.

  • markm (unregistered) in reply to kaewberg

    Yes, if you are going to use separators in the decimal part (which is unusual), the digits should be grouped in threes starting from the decimal point like: "$1,290.139,999,999,9"

    But that's only the third thing this programmer got wrong.

    (1) Using floating point for money at all. Add up enough floating point numbers and you get a result that's off by a cent or more. Accountants will notice.

    (2) Not rounding off to the customary smallest unit: "$1,290.14". That run on decimal will confuse the heck out of Americans with the usual rudimentary understanding of math. For someone like me that started programming with FORTRAN 2 (IIRC), it just tells me that the programmer doesn't understand what he's doing. What else did he mess up?

    (3) Not only displaying what shouldn't have been displayed, but formatting it wrong.

  • Ken Bluntrich (unregistered)

    It says a lot about web developers when the majority of Error'd screenshots are from web apps.

    TRWTF is censoring your name in the screenshot, and then having TDWTF post it in the article description anyway.

  • 516052 (unregistered)

    And that is why we need certification and licencing. Use floating points for money? Licence revoked, fingers broken so you can't ever code again.

  • Gassy (unregistered)

    The price is only going up with the hurricane coming through. ~$14-15/day seems like a lot still... Also, I recommend purchasing more fresh fruits and vegetables at your local grocery store.

    At first thought, it's possible the programmer simply converted the decimal to a float at the last minute so they could use the display formatters, but then didn't use them...

  • Beauty stoke (unregistered)
    Comment held for moderation.
  • दिवियाश (unregistered)
    Comment held for moderation.
  • Clubs21id.com (unregistered)
    Comment held for moderation.
  • James (unregistered) in reply to Ken Bluntrich
    Comment held for moderation.

Leave a comment on “Hunger”

Log In or post as a guest

Replying to comment #:

« Return to Article