Stories
Slash Boxes
Comments
typodupeerror delete not in

Comments: 420 +-   Moving Decimal Bug Loses Money on Wednesday November 25, @10:13AM

Posted by CmdrTaco on Wednesday November 25, @10:13AM
from the test-your-code-people dept.
humor
money
idle
mario.m7 writes "Poste Italiane, the Italian postal service, suffered yesterday from an abnormal computation in ATM and credit card operations, since the decimal comma was not taken into account. The whole sum was therefore multiplied by 100, resulting in a 115,00 Euro transaction being debited as 11.500 Euro! Thousands of accounts are deep in the red and locked (link pumped through translator), so that no more operations are possible. Poste Italiane is gradually recovering the problem, fixing the error and re-crediting the sum debited in excess. Consumer associations have offered support to clients in case this lasts longer and causes damage."
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • You mean 11,500 Euro (Score:5, Informative)

    by Chrisq (894406) on Wednesday November 25, @10:17AM (#30226162)
    You mean 11,500 Euro as 11.500 Euro.
    • by Razalhague (1497249) on Wednesday November 25, @10:24AM (#30226270) Homepage
      No, I think he means 115 Euro as 11500 Euro (thousands separators are more trouble than they're worth).
      • Re: (Score:3, Funny)

        by auric_dude (610172)
        Could be worse, could have still been using Italian Lira then the numbers would be really big http://en.wikipedia.org/wiki/Italian_lira#Banknotes [wikipedia.org]
        • by mea37 (1201159) on Wednesday November 25, @11:32AM (#30227126)

          You're letting the punctuation confuse you. The computer doesn't use punctuation to represent the number.

          The error was essentially that a number of Euro cents was interpreted as a number of Euro.

          So if someone entered 11500 euro cents (115.00 Euro using American punctuation, 115,00 using European punctuation - which seems fair since we're counting Euros), and the display showed them that this is what they had entered, but the computer interpreted it as 11500 euros (11,500 using American punctuation, 11.500 using European). Just as TFS says.

          "without _moving_ the seperator (or omitting it completely)" ... which is exactly what the summary says happened. Hell, did you even read the headline?

      • by haruharaharu (443975) on Wednesday November 25, @11:23AM (#30227012) Homepage

        You know, I really never understood the decimal point being a comma. But then again, I'm an American.

        Yeah, why can't everyone do it like I do it?

        • by Lord Ender (156273) on Wednesday November 25, @12:59PM (#30228216) Homepage

          Yeah, why can't everyone do it like I do it?

          That's a bit naive of you. A better question is: why can't everyone do it the same way? Having a universal standard like this would have many advantages, while having multiple differing formats has only disadvantages.

          So a reasonable person is left with the conclusion: doing it the same way everywhere is better. The question naturally follows: which would make a better standard?

          The answer to this is: the English way. Why? Because when writing in any language, multiple commas may be used indicating the continuation of the sentence, just as they may be used indicating the continuation of an integer in English number notation. Furthermore, in any language, a period is used to indicate the end of a sentence, similarly to how they are used in English number notation to indicate the end of the integer.

          The English way of writing numbers is simply superior, as it is consistent with the way punctuation is used in all languages.

          To illustrate my point. I leave you with this bizzare. confusing continental-style punctuation use,

          Silly. n'est-ce pas?

              • by haruharaharu (443975) on Wednesday November 25, @01:41PM (#30228786) Homepage

                ink dots on fountain written text. It's far easier to be sure about a comma rather than some stupid splatter. Regardless, people will disagree with you, so we still have the same problem.

                Part of the reason is there isn't a compelling argument either way - yours is ok, but not really gripping. But what did you expect? It's commas.

  • by dkleinsc (563838) on Wednesday November 25, @10:17AM (#30226166)

    I always do that, I mess up some mundane detail!

  • by jellomizer (103300) on Wednesday November 25, @10:17AM (#30226172)

    Our Comma to separate numbers and periods to indicate decimal are far superior to your backward period to separate numbers and comma to indicate a decimal number!

    • by benwiggy (1262536) on Wednesday November 25, @10:30AM (#30226332)

      I think you mean "God Save the Queen". We (the British) gave you the correct method for decimals before we decided to let you have the place. You've managed to pick up a few bad habits from the French, such as driving on the right.

      But apart from that, you're doing quite well.

      (For the benefit of Australians, this is humour, not flamebait.)

      • by Anonymous Coward on Wednesday November 25, @10:32AM (#30226344)

        I think you mean "God Save the Queen". We (the British) gave you the correct method for decimals before we decided to let you have the place. You've managed to pick up a few bad habits from the French, such as driving on the right.

        But apart from that, you're doing quite well.

        (For the benefit of Australians, this is humour, not flamebait.)

        Oh be quiet, you whinging pommy bastard.

      • by Kartoffel (30238) on Wednesday November 25, @10:47AM (#30226556)

        Australians seem to be doing even better than Americans, then. They still drive on the proper side of the road, although they measure distances in kilometers rather than miles as god and the queen intended.

        Well at least Australia is doing better than Canada. Those poor sods drive on the wrong side *and* use the metric system on their roads.

        • by IrquiM (471313) on Wednesday November 25, @11:50AM (#30227320) Homepage

          I think I read somewhere that the Australians would change from left to right in 2012. They would start with all the bigger vehicles like buses and lorries and if that turns out OK, it'll be mandatory for all motorized vehicles from 2015

          • Re: (Score:3, Funny)

            So, do you ever get an American quarter in your change and think "Sweet, an American quarter". Until you try to use it in a vending machine.
            • Re: (Score:3, Funny)

              We can't afford to change all the signs. We spent all our wealth fighting marijuana, keeping out Mexicans, and building public basketball arenas.
            • by Duradin (1261418) on Wednesday November 25, @11:59AM (#30227426)

              Look at what those numbers are divisible by:
              12 can be divided evenly by 2,3,4 or 6.
              36 can be divided evenly by 2,3,4,6,9,12,18.
              5280 can be divided evenly by 2, 3, 4, 5, 6, 8, 10, 11, 12, 15, 16, 20, 22, 24, 30, 32, 33, 40, 44, 48, 55, 60, 66, 80, 88, 96, 110, 120, 132, 160, 165, 176, 220, 240, 264, 330, 352, 440, 480, 528, 660, 880, 1056, 1320, 1760, 2640. The important ones being 2,3,4,5,6,8,10.

              Plus metric measurements are generally too small (cm) or too big (m) to be practical for day to day uses.

              So if you look at it from a pencil and paper math era perspective having the nice fractions was a plus. (
              It's why we (thankfully) don't have metric time. 60 is divisible by 2,3,4,5,6,10,12,15,20, and 30. 100 is only divisible by 2,5,10,20,25, and 50. The Babylonians were onto something.)

              • by Daimanta (1140543) on Wednesday November 25, @01:16PM (#30228434) Journal

                "Plus metric measurements are generally too small (cm) or too big (m) to be practical for day to day uses."

                Furthermore imperial measurements are generally too large (inch) or too small (yard) to be practical for day to day users. The fact that the mile exists also creates confusion because every old nations used to have it's own "mile" which either a lot bigger or a lot smaller than the English "mile".

                Also multiplication by a number that is not equal to the numberbase(10) is annoying to use.

                Out of the top of my head

                1000mm=100cm=100dm=1m=0,1Dm=0,01hm=0,001km=0,000001Mm

                Try to do that with the imperial system which randomly swaps between 6,2,12 and whatever they feel like.

    • by Yvanhoe (564877) on Wednesday November 25, @10:35AM (#30226382) Journal
      Do you know the nightmarish hell that is an Excel localized in French while being part of an international team ? Copy-paste of the same data using Excel EN or Excel FR will result in either 115.5 or 115,5 leading to interesting bugs to track...
      • Re: (Score:3, Interesting)

        by teg (97890)
        Not only that, the function names are localized too IIRC - meaning that a simple sum() doesn't work, as you should be using summ(). Copy, paste, and just plain sharing internationally doesn't work too well.
    • by AP31R0N (723649) on Wednesday November 25, @10:38AM (#30226436)

      Our method makes more sense. A sentence can have more commas than periods. Generally sentences have just one period (i'm distinguishing between dots and periods here). A period is a more solid division than a comma. It makes more sense to use the stronger punctuation as the mark between whole and fraction.

      i'll grant that metric is better than imperial, but i think this is one thing where we have the better idea.

      It's my opinion and it's worth every penny you paid for it.

    • by domulys (1431537) on Wednesday November 25, @10:39AM (#30226450)
      It is obvious to the most simple minded that Loki is of an inferior breed.

      I am black on the right side. Loki is WHITE on the right side, all of his people are white on the right side!
  • by Anonymous Coward on Wednesday November 25, @10:18AM (#30226182)

    1,00st post!

  • by Anonymous Coward on Wednesday November 25, @10:23AM (#30226258)

    Good thing the programmers will be shielded from any consequences from this little 'bug'.

    It doesn't matter that it caused potential harm to clients, corporations in the form of losses, lost time, expenses, etc.

    The simple programmers just need to release a hot-fix or service pack.

    Now if these were engineers, and I mean real engineers not "software engineers", there would be consequences.

    Their licenses could be revoked, they could be investigated for incompetence, and held professionally and personally liable for any bugs.

    But please, keep on purchasing software with NO WARRANTY, or NO FITNESS FOR A PARTICULAR PURPOSE, and that contains KNOWN DEFECTS.

    Gotta keep the programming industry alive, and don't wanna stress theses "engineers" too much.

    • Re: (Score:3, Interesting)

      well I'm a 'formal' engineer... but let's be frank here.

      The world has not come to an end.
      The accounts will be fixed.
      The clients will not lose any money.

      Yeah, nothing would make me happy than requiring every line of software to be written by a real engineer with responsibilities, but it's more for my benefit than society's (job security, competent colleagues.. you know how doctors and lawyers do it).

      In the end, society is making the trade offs.
      Society is choosing to have features developed faster than a pro

  • by MaWeiTao (908546) on Wednesday November 25, @10:36AM (#30226394)

    I never understood why the hell Europeans swap periods and commas. Grammatically it doesn't even make sense.

    A period ends a sentence or statement, which to me should imply a whole number. A comma is simply a separator, used within sentences. So why would it be used to separate decimals?

    It would be like writing a sentence this way:
    I went to the supermarket to buy some cola. cabbages. and condoms,

    Maybe there's a very good reason for it, but I don't see it.

    Regarding the story on hand, that really sucks. I wonder if they will pull the same garbage as American banks where customers only have 60 days to report a problem otherwise nothing will be done. Whereas, if the bank screws up in your favor, they could go into your account 20 years from now and withdraw whatever extra money they gave you.

    • by mccalli (323026) on Wednesday November 25, @10:42AM (#30226510) Homepage
      I never understood why the hell Europeans swap periods and commas. Grammatically it doesn't even make sense...A period ends a sentence or statement, which to me should imply a whole number. A comma is simply a separator, used within sentences. So why would it be used to separate decimals?

      See, that argument doesn't make 'sense' either. If a comma is a separator, why not use it to separate decimals? Answer: no reason, it is completely and utterly arbitrary. You're arguing that the point of view you're used to is somehow intrinsicly 'right' - it isn't, it's just usage and custom.

      It would be like writing a sentence this way:

      Somehow, I suspect mainland Europe knows what it's like to write a sentence including thousands sperators and decimal separators...

      I'm British - I use "," to separate thousands and "." to separate decimals, but that doesn't make me 'right' - it really is just usage and custom, there isn't anything to really recommend one way over the other.

      Cheers,
      Ian
      • Re: (Score:3, Interesting)

        by Hatta (162192)

        If a comma is a separator, why not use it to separate decimals?

        A number can only have one decimal separator. A sentence can have only one period.

        A number can have many thousands separators. A sentence can have many commas.

        This isn't a strong argument, but in the absence of any reason to do it otherwise it's better to do it in the marginally more consistent way.

        • Re: (Score:3, Interesting)

          by mccalli (323026)
          In matters of custom, the more universally recognized method is the right one.

          OK then - here you go [wolframalpha.com]. I await the US and Britain's change to the 'universal' standard with interest.

          If you want to implement a new worldwide custom then that's fine but I suspect you will need a very good justification and not simply the desire to do something new.

          New? Err...no, no this isn't new. It's centuries old. What's happened here is some US-centric programmer has forgotten to do a locale conversion. Happened to m
          • Re: (Score:3, Informative)

            by Fzz (153115)
            I await the US and Britain's change to the 'universal' standard with interest.

            Um, maybe look again [wikipedia.org]. Most of Asia including India, China and Japan uses a decimal point rather than a decimal comma. If you want a popularity contest, dot wins.

            But it's not really about popularity is it? If the accompanying text is English, it should be a dot. If the accompanying text is French it should be a comma. Unless you're Canadian, in which case you're probably just confused.

  • This is stupid. (Score:3, Insightful)

    by BlueKitties (1541613) on Wednesday November 25, @10:39AM (#30226440)
    There's a reason we separate the data model from the external view and internal controller mechanisms. A moving decimal shouldn't affect the internal math, it should be nothing more than a harmless display error. The fact a moving decimal actually affected the internal management is sad. Well, maybe I'm being an elitist boob, but this seems more like negligent high level design that compounded a low level bug into being much worse than it should have been.
  • by Kartoffel (30238) on Wednesday November 25, @10:39AM (#30226442)

    It's just like in Superman III, but backwards!

  • by Acer500 (846698) on Wednesday November 25, @10:45AM (#30226538) Journal
    I made a similar mistake recently... I made a (.NET) data entry software that received monetary quantities as user input, and I converted them without taking into account the Windows settings for decimals and thousands separators.

    It worked fine until somebody used a different language OS... and some strange quantities were recorded, one slipped all the way through the process and a confused customer received a bill for 17.000.000 local currency (about U$ 1.000.000) . I fixed it by using the CultureInfo, etc.. .when converting, but it wasn't nice, messed with all of the higher ups' reports and everything ("Hey, hadn't we sold about U$ 1.000.000 more?" "No, it was an error from G in Development")

    I'm sure there are better ways and good practices, but keep in mind that where I work we don't even have testing, so I guess I'm getting sloppy. If someone wants to give advice, go ahead, I'll appreciate it (or at least should :) ).
    • by eallanjr (1069538) on Wednesday November 25, @11:22AM (#30227004)

      I made a similar mistake recently... I made a (.NET) data entry software

      Don't you mean ,Net?

    • Re: (Score:3, Interesting)

      You've got to handle that problem at the application layer, preferably as soon as possible.

      Before converting it to a double or float point or whatever you are using, you have to do some data verification. Similarily, you wouldn't want someone putting in "ABC.75" dollars, because that can't be parsed, you have to handle all those scenarios. A try-catch will work for the obvious ones (like I stated) but there are some simple tips to help with the , and . translation done by the OS's.

      All of it is done by handl

  • by maxwells daemon (105725) on Wednesday November 25, @11:00AM (#30226720)

    This is not a representation issue. It is a project management and testing issue.

    • by imgod2u (812837) on Wednesday November 25, @10:23AM (#30226264) Homepage

      It's like the little penny tray. The pennies are for everyone. And we're just taking fractions of a penny here.

    • Re: (Score:3, Informative)

      by sopssa (1498795) *

      This is the same in my bank, if you type in . it gives an error. In addition it requires you to type in the ,00 too, and next to the sum text box is an example like "150,00".

      Having comma/decimal as a separator is stupid anyway, space does just fine - 150 000.35

      • by sopssa (1498795) * on Wednesday November 25, @10:33AM (#30226356)

        int64 Unsigned: 0 to +18,446,744,073,709,551,615

        You mean I cannot transfer my 18 quintillion, 446 quadrillion, 744 trillion, 73 billion, 709 million, 551 thousand and 615 dollars (or in easier words 18 billion billion dollars) as a single transfer from my banking account? I need to do two of them? This is outrageous!

      • by radish (98371) on Wednesday November 25, @10:41AM (#30226476) Homepage

        Using strings to store numbers internally is wrong, it just is. It's slow, wasteful, and unnessecary. I don't think I've ever (in 20 years of coding) needed to store something bigger than 2^64, but if I did, there are plenty of options (e.g. BigDecimal in Java, bigint in Perl, etc) which are essentially unlimited in size. Doing math with strings is just such a horrible concept :) As for precision floats (i.e. fixed point) there are real solutions for that issue in most languages too. String isn't one of them.

        Exchanging your data with other systems (e.g. generating a web page, or XML, or whatever) is of course an entirely different story, you do what makes sense for the requirements. XML Schema, for example, mandates that a parser has to accept up to an 18-digit value for the digit type, but doesn't set an upper bound. So you need knowledge of the parser to know how to transfer very large values.

        • Re: (Score:3, Insightful)

          Doing math with strings will guarantee your code a place on the front page of thedailywtf.com
            • Re: (Score:3, Insightful)

              In reality an ATM doesn't need any decimal point. Unless there's some ATM out there that dispenses anything coins.

              I've never understood why every ATM that I've ever used that dispensed $20 bills made me type in the 00 cents each and every time.

      • by ls671 (1122017) *

        Huh, haven't you heard of BigInteger like data types ?

        They are pretty common in accounting in various languages...

        http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigInteger.html [sun.com]

    • Re: (Score:3, Informative)

      by emm-tee (23371)

      ...it's worth clarifying whether they're using the decimal or comma convention in the summary itself!

      Yep the submitter got it wrong. Given that he is posting in English, to an American website, it makes no sense to use the comma as the decimal separator and the period as the thousands separator (unless the idea was to intentionally cause confusion to prove the point).

      With a few exceptions (e.g. South Africa), the rule of thumb seems to be that if you're using English, you use "." as the decimal separator.

      Wikipedia has a very long article on these things http://en.wikipedia.org/wiki/Decimal_separator [wikipedia.org], but

One person's error is another person's data.