• (nodebb)

    This is not w WTF, it's pre-emptive revenge for an imminent firing.

    $suite_23_1 = number_format($item -> {'suite_2_1_'.$the_currency}, 2, '.', ''); is used 99% of the time.

    $suite_89_3 = number_format($item -> {'suite_2_2_'.$the_currency}, 2, '.', '') is used 1% of the time.

    after firing the line suddenly reads: $suite_89_3 = number_format($item -> {'suite_2_2_'.$the_currency}, 2, ',', '')

  • Sauron (unregistered)

    TRWTF is money.

  • Dark Horse (unregistered)

    It's even worse, the object is retrieved form the database, so its attributes are columns in the database, and its even more worse when you see how the writing and the updating is done for these tables (yes there are a lot of tables with this design)...

  • Dvon Edzore (unregistered)

    Guessing this is a pricing application that duplicates exactly the old printed item lists with both annual volume discount levels (per customer) and quantity discount levels (per item per order.) Rather than calculating the price on the fly, and running the unacceptable risk of not matching the printed price sheets to the penny, this app simulates a clerk doing it the way it was done 150 years ago when people were nice and life was good.

  • (nodebb)

    Someone was paid by the line.

  • JJ (unregistered)

    There might be good things to say about having a metric crapload of variables in a class, IFF your class, being part of an options package, constructs by serialization from some moral equivalent of a config file.

    As being written, however, this (not being part of something similar) is garden variety crap, upon which I agree they should've bought some arrays.. Perhaps DarkHorse is right.

  • Argle (unregistered) in reply to mynameishidden

    Not necessarily paid by the line. As the adage goes, never attribute to malice that which can be adequately explained by stupidity. I've had a huge numbers of intro-to-programming students over the years. Some paid attention and I'm sure went on to fine careers. Others were in a world of their own and never really learned. One student's assignment comes to mind: after a lecture about C's 'toupper()' he wrote a big switch statement whose case statements were lower case letters and the statement was the upper-case version. I'm sure he's out there programming still and botching everything.

  • Duston (unregistered)

    "unacceptable risk of not matching the printed price sheets to the penny" I worked in a place where the software had to match the printed price sheets to the penny. Except the printed price sheets had errors so the software had to match the errors to the penny as well. Talk about your magic numbers....

  • JP (unregistered)

    Duh, it's a tool issue. It's not the developers' fault that PHP doesn't support -funroll-loops!

  • Dark Horse (unregistered) in reply to Dvon Edzore

    Those are suites/rooms prices for different hotels, the first digit is for the hotel, the second is the number of beds and third for the currency.

  • monstro (unregistered)

    "It's definitely a limitation of the tool, not something the developers can control. PHP just doesn't have support for -funroll-loops!"

  • (nodebb)

    This is just a newb who doesn't understand arrays yet. TRWTF is that they had a job programming at this point in their development :/

Leave a comment on “Currency Format”

Log In or post as a guest

Replying to comment #:

« Return to Article