Moving Decimal Bug Loses Money
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."
I always do that, I mess up some mundane detail!
I am officially gone from
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!
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
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.
---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"
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
It's still a decimal point. Europeans just put a little tail on it to be fancy.
I made a similar mistake recently... I made a (.NET) data entry software
Don't you mean ,Net?
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?
Reboot macht Frei.