• bluesman (unregistered)

    2.5000 is the new 2.500?

  • (cs)

    So TRWTF is that Andy can't handle fixed-point math?

  • Andrew (unregistered)

    Once the sales manager cleared the scene, he rounded his desk, gathered up the invoices, and reached for his nearest resume.

    FTFY

  • fanguad (unregistered)

    I'm personally curious how he managed to store 2.5 in a 16 bit int.

  • Retsila (unregistered)

    The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

    That really is stupid

  • Leo (unregistered)

    5000th post!

  • Rodnas (unregistered)

    Aaah, the good old days of 6502 assembly. I still have a C64 hidden somewhere in my house for sentimental reasons. Ofc in those days i didn't have to worry about invoice printing. I was just a kid trying his hands on this new thing called personal computers and programming. Which meant playing Fort Apocalypse, Impossible Mission and Aztec Challenge a lot. Until the boredom set in and i wanted to make my own games. That is how it all started for me. In the end there was no great games programming career for me, but now there a customers complaining about the layout of their invoices. I should get back to work.

  • (cs) in reply to Retsila
    Retsila:
    The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

    That really is stupid

    I was also wondering about that. People who think that nothing's impossible if you yell loud enough and for long enough generally are also more than willing to lie when it suits their purposes.
  • Wody (unregistered)

    He's obviously not very smart, all he had to do was write a single line to the invoice 'all tonnage values must be multiplied by 1000 for actual values'

  • (cs)

    "Figure it out, and give my customers a readable print-out!"

    I only hope that all the sales manager's personal customers are clearly marked in the database. Otherwise that feature request is impossible to implement...

  • Mike (unregistered)

    This is a very sad story.

  • Tim (unregistered) in reply to Wody
    Wody:
    He's obviously not very smart, all he had to do was write a single line to the invoice 'all tonnage values must be multiplied by 1000 for actual values'

    Or just "all values are in European standard kilotonnes"

  • (cs)

    So many WTFs!

    But in the article itself...

    I can't understand why anyone would write invoicing software for a PET 4032 in assembler, when the built-in basic handled that sort of task perfectly well. Writing assembler for a PET was not trivial - machine code directly entered in hex was not uncommon for speed, but assembler generally required a whole load of messing around.

    Also, I wrote accounting software at about this time and I never saw anyone print invoices on green-lined paper!

    On top of all of this - thinking that "adding three zeroes" to the number would give the correct answer makes Andy TRWTF!

  • (cs) in reply to fanguad

    I'm personally curious how he managed to store 2.5 in a 16 bit int.

    What's the problem? 2 in a byte, 128 in another - voilá!

    Ever heard of fixed-point math?

  • the beholder (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Retsila:
    The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?

    That really is stupid

    I was also wondering about that. People who think that nothing's impossible if you yell loud enough and for long enough generally are also more than willing to lie when it suits their purposes.
    I was thinking the same thing. I guess I've been close to sneaky bastards long enough to learn not to trust customers or cow-orkers on spoken words alone.

    Also TRWTF is that Andy can't handle fixed point math. The least he should do is check how many zeroes actually must be appended for a correct conversion.

  • Doo-doo Facial Hair (unregistered) in reply to GettinSadda

    TRWTF is someone writing that kind of software in the early 1980s for an 8-bit computer in something other than Basic.

    And the only kind of green-, blue-, or brown-lined paper I remember from back in the day was used to print out source code or listings, not documents for customers, but maybe such a thing was done somewhere vOv.

  • ewanm89 (unregistered)

    The easiest option, is multiply the quantity by 10 and convert to int, then add 2 0's hard coded into the printout.

  • Grumpy (unregistered)

    When I was your age, everything was greenbar and we liked it!

    Then some weenie invented 8 1/2 x 11 white paper, with perforated strips along the edges that you could tear off. Which was all fine and dandy, except the printer was wide enough for greenbar and the white stuff didn't fit. Then you needed adjustable roller thingies. Then someone would spool a job without realizing there was white paper in the printer, and it would print right off the edge. Devil spawn, I tell you! Give me back my greenbar!

    You young 'uns missed out. Why you could walk around with a wad of greenbar tucked under your arm, and it was as good as a roll of hundred dollar bills. Chicks instantly realized that you were in the big-money computer business, a rising star!

  • Fred (unregistered)

    I call shenanigans! Anyone who was there knows that every report had as much info as possible crammed into the inflexible limit of 132 columns. There's no way you could add three zeros, or even one, to anything without running out of room.

    Basically any requirements session boiled down to "if we cut off the last name at 8 characters we can add four digits to the zip code -- is that what you really want?"

  • (cs) in reply to Andrew
    Andrew:
    Once the sales manager cleared the scene, he rounded his desk, gathered up the invoices, and reached for his nearest resume.

    FTFY

    Hardly. Sales guys tend to have higher turnover than most.

    Should be, "Gathered up the invoices, shredded them, restored the code to the original form, and then went home for the day. Later that week, the sales guy tried to get Andy fired, but ended up having his ears thumped by management. Everyone else was happy!"

  • Mike (unregistered) in reply to ewanm89

    The easiest option is to multiply by 1000!

  • Abico (unregistered)

    Sorry, but Andy is in the wrong here. Maybe the guy was as much as a dick as his story says, but he did nothing to explain the problem. And on top of that, his solution was wrong.

  • Smug Unix User (unregistered)

    This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.

  • Smug Unix User (unregistered)

    This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.

  • Chris (unregistered)

    So, without the decimal place, 2 becomes 2000 but 2.5 becomes 25000, that there is the REAL WTF!

  • (cs) in reply to Abico
    Abico:
    Sorry, but Andy is in the wrong here. Maybe the guy was as much as a dick as his story says, but he did nothing to explain the problem. And on top of that, his solution was wrong.
    Very true. Just appending three zeroes in order to make a decimal value appear as though it's multiplied by 1000? Any idiot should know that this does not work, so he can only have done this in order to piss off this manager. Whether or not he deserved it, 5 minutes of decent coding would have had this sales manager out of his hair for the rest of the day. Instead he chose to ignore his wishes, rush the job, be cheeky and lie about it and ended up using whiteout on a stack of invoices, costing him time that he could and should have spent doing his actual job.
  • bemis (unregistered)

    I take it the WTF is how poorly Andy handled this situation?

    Slap on an extra three 0's, really?

  • bemis (unregistered) in reply to Mike
    Mike:
    The easiest option is to multiply by 1000!

    Umm... I think you might have missed something...

  • anonymous (unregistered)

    Waidaminute...

    Doesn't an invoice usually take the form of:

    Item A Qty of A x Unit Price of A = Amount of A Item A Qty of B x Unit Price of B = Amount of B Item A Qty of C x Unit Price of C = Amount of C Grand total

    Presumably the unit prices were all in kilotons before, so if Andy just changed the way the quantities were display without also changing the unit prices, the invoice would be all kinds of messed up. TRWTF is that the company let Andy anywhere near any sort of maths. Maybe he should have been fired.

  • (cs)

    What the hell were they selling hundreds of thousands of tons of?

  • (cs)

    Is it really that hard?

    ; Assuming Val is 16-bit Qty / 100
    LDA (ValLo)     ; Load the low byte
    TAY             ; Put in Y
    LDA (ValHi)     ; Load the high byte
    JSR GIVAYF      ; Convert to float in acc 1
    JSR MUL10       ; Multiply by 10 (is now Qty / 10)
    JSR MUL10       ; Multiply by 10 (is now Qty)
    JSR FOUT        ; Format as string in output area
  • Pluvius (unregistered) in reply to biziclop
    biziclop:
    What the hell were they selling hundreds of thousands of tons of?

    Toenails.

  • Mike (unregistered)

    Just got done loading two new boxes of greenbar into our ancient beast, so I am getting a kick out of this.

  • OldCoder (unregistered) in reply to biziclop
    biziclop:
    What the hell were they selling hundreds of thousands of tons of?
    Don't get out much, do you? Grain? Coal? Steel? Fertilizer? Fish? Cement?

    I could go on, but I have a website to read.

  • jc (unregistered) in reply to fanguad

    you obviously didn't ever hear about fixed point decimals.

  • (cs)

    The first 5 comments are good comments! What has happenned to this site?

  • corroded (unregistered)

    The Real WTF is Andy.

    Uses hack, creates inconsistent output that is confusing and makes the problem worse than before. Acts like a bit of an arse to boot.

    Should have said it wasn't possible, and explained why.

  • fanguad (unregistered) in reply to flop
    flop:
    > I'm personally curious how he managed to store 2.5 in a 16 bit int.

    What's the problem? 2 in a byte, 128 in another - voilá!

    Ever heard of fixed-point math?

    You certainly could do fixed point math, but this specifies that the largest value he could store in his 16 bit word is 65536 - which means he's using unsigned integers.

    In reality, they probably did use fixed point math and "TRWTF" is all the errors introduced during the re-writing of submissions.

  • Excelsior (unregistered)

    Pretty story, but TRWTF is Andy being to lazy to do its actual job, or being able to stand his ground (who changes customers invoices snapping his fingers ?).

    Whatever...

  • tim (unregistered) in reply to NMe
    NMe:
    ...and ended up using whiteout on a stack of invoices, costing him time that he could and should have spent doing his actual job.
    LOL - in the UK we only have Tipp-Ex and i've never heard of whiteout. Until I read NMe's comment, I assumed whiteout was some kind of strong cider and he was just going to get hammered :-) (oh - and just to add to the confusion, cider is different in the UK too)
  • (cs)

    As well as tipp-ex we used to have liquid paper.

    Pretty-printing of numbers is tricky. Anyone want to try it in their favourite language?

    My guess is that they were storing "fixed point" numbers if they allowed 2.5

  • Publius (unregistered)

    This sounds like a fairly trivial problem to solve, even in 6502 assembly, I get the impression this guy is just lazy. If the same invoice printing code is in 600 different places, write a set of find/replace expressions? Original submitter, please feel free to chime in on how the editor messed up your story.

  • Publius (unregistered) in reply to GettinSadda
    GettinSadda:
    So many WTFs!

    But in the article itself...

    I can't understand why anyone would write invoicing software for a PET 4032 in assembler, when the built-in basic handled that sort of task perfectly well. Writing assembler for a PET was not trivial - machine code directly entered in hex was not uncommon for speed, but assembler generally required a whole load of messing around.

    Also, I wrote accounting software at about this time and I never saw anyone print invoices on green-lined paper!

    On top of all of this - thinking that "adding three zeroes" to the number would give the correct answer makes Andy TRWTF!

    I can confirm that to this day Walmart still prints out accounting totals on green-lined paper on dot matrix printers.

  • (cs) in reply to Publius
    Publius:
    I can confirm that to this day Walmart still prints out accounting totals on green-lined paper on dot matrix printers.
    Yes, but accounting totals are NOT invoices!
  • Captcha:appellatio (unregistered) in reply to Zecc
    Zecc:
    The first 5 comments are good comments! What has happenned to this site?
    It got fascist mods.

    You fascists!

  • lesle (unregistered) in reply to tim

    Wite-Out, no h. https://en.wikipedia.org/wiki/Wite-Out

  • justsomedudette (unregistered)

    I miss greenbar; I miss making little springs out of the perforated edges sigh

  • lesle (unregistered) in reply to lesle
    lesle:
    Wite-Out, no h. https://en.wikipedia.org/wiki/Wite-Out

    Non-pertinent but interesting information here: https://en.wikipedia.org/wiki/Correction_fluid

  • bkDJ (unregistered)

    So, he didn't get confirmation from his boss, his solution was laughably wrong and terrible, he acted like even more of an ass than the sales guy at the end, and then decided to use wite-out instead of fix the code properly and leave for the day? TRWTF is Andy. Also someone needs to teach the new writers that we like our HTML comments.

    Speaking of writers... "Because he wanted to knock off at 3:02, obviously." Knock off...? As an American, the only thing that means to me (when it doesn't take an object, i.e. "knock it off") is to copy something (possibly cheaply), so what is the author trying to say here?

  • TRWTF (unregistered)

    The real problem is that 2.5000 is wrong. He added three 000 to both 2 and 2.5 which gets you 2 thousand and 25 thousand. Also, if this was for Europe it should have been a comma in the abbreviated version. TRWTF is the fail programmer.

Leave a comment on “Wordy Invoice”

Log In or post as a guest

Replying to comment #394256:

« Return to Article