Your bill is £30.5...
-
Ok, fairly minor one, but...
Is that 5p or 50p? (The latter if anyone's actually interested.)
-
And that is why @deity invented format strings
-
-
@RaceProUK said:
And that is why @deity invented
format stringsnot using floats for currencyattention to detail...and testingFTFY
-
@RaceProUK said:
And that is why @deity invented
format stringsnot using floats for currencyFTFY
They could be using a decimal library. You have no way of knowing. All you DO know is they f'ed up the formatting when displaying it.
-
A quick survey of organic gluten free coffee shops in the area will show you that this is actually the trendy new way of writing such things.
-
When writing checks (in the U.S.), I used to write the portions of the fraction of the dollar with the lowest accurate denominator, e.g. 13 4/25 dollars instead of the more common 13 16/100 dollars. To my shock, the banks didn't always handle it correctly.
-
Is that 5p or 50p?
For that to be 5p wouldn't it have to be £30.05 ?
3.5€ == 3€ + 50¢ && 3.05€ == 3€ + 5¢
Wouldn't it be great if we could write code like that? Hell, at least store it in a database like that.
Imagine the possibilities:
if(3.5€ == US$3.4@Today) then sell() else buy();
-
-
Fun fact: since C++11 supports Unicode identifiers and user-defined literals, it should be possible to make this syntax work.
-
For that to be 5p wouldn't it have to be £30.05 ?
Not necessarily - that's the point. They're missing padding - whether it's before or after the 5 it's not clear.
-
For that to be 5p wouldn't it have to be £30.05 ?
Depends on whether you’re talking to someone from Belgium or not. More than once I’ve been confused by them saying things like “one euro five” meaning not one euro and five cents, but one euro and fifty cents.
-
-
More than once I’ve been confused by them saying things like “one euro five” meaning not one euro and five cents, but one euro and fifty cents.
belgium?!
Not even I do that, and I love messing with peoples' heads.
-
My guess is it’s because of the low value of the old Belgian franc, so people weren’t used to money in denominations lower than one franc — with the result that, as @Luhmann says, some (many?) write “€1,5” and also pronounce it as such.
-
Not necessarily - that's the point. They're missing padding - whether it's before or after the 5 it's not clear.
I think this must be a consequence of your weird historical money system. That would be oddly formatted but unambiguous in $US, where I guess we have a metric money system.
-
We could always go back to getting high on £sd...
-
@Eldelshell said:
For that to be 5p wouldn't it have to be £30.05 ?
Not necessarily - that's the point. They're missing padding - whether it's before or after the 5 it's not clear.
Go back to a school you attended and tell one of your Maths instructors that you think
30.5 == 30.05
. Oh, and make sure to record their response so we can all see it.
-
Go back to a school you attended and tell one of your Maths instructors that you think
30.5 == 30.05
.I don't.
English money, when specifying (whole) pence, MUST have two numbers after the decimal point. It is malformed otherwise.
Seeing only one number after the decimal point indicates some formatting SNAFU. For those that don't see that this is a problem I give you:
[pjh@thinkpad tmp]$ cat voda.c #include <stdio.h> int main(void){ int thirty_five = 3005; // £30.05 int thirty_fifty = 3050; // £30.50 printf("%d.%d\n", thirty_five/100, thirty_five%100); printf("%g\n", thirty_fifty/100.); return 0; }[pjh@thinkpad tmp]$ ./voda 30.5 30.5 [pjh@thinkpad tmp]$
@powerlord - could you tell me what, in those two lines of output, indicates the 45p difference between the values they represent that you seem to think exists?
-
@powerlord - could you tell me what, in those two lines of output, indicates the 45p difference between the values they represent that you seem to think exists?
Again, you're assuming that they're using integers rather than a multi-precision and/or fixed point decimal library.
Is there any language other than C/C++ that doesn't have one of these built in these days?
- C# does
- Python does
- Java does (even if it does have awkward syntax)
- Ruby does
- PHP does
- Node doesn't, but you can install bigdecimal from npm
- C/C++ doesn't, but has several options you can presumably statically link. IBM used to make one as well, although I can't find a reference to it.
The thing about it is this: If you're using a decimal library like these, the output is missing the 0 at the end... you can never be missing the middle one.
-
Again, you're assuming that they're using integers rather than a multi-precision and/or fixed point decimal library.
This is Vodafone we're talking about. The company that continued to accept credits on PAYG phones that they cancelled through non-use, and caused (or certainly contributed) to one death.
Fucking up currency display and/or calculations is certainly not beyond them.
-
There is no WTF here.
30.5 is a perfectly cromulent way of writing that number.
-
Depends on whether you’re talking to someone from Belgium or not. More than once I’ve been confused by them saying things like “one euro five” meaning not one euro and five cents, but one euro and fifty cents.
And you people complain about our date format.
-
It's a perfectly valid number. But it's not a valid amount of Euros or, apparently, pounds.
€30.50 or, if you must, €30½.
-
This is Vodafone we're talking about.
Here in the US, at least some carriers allow you to buy a one year card, that extends your phone's expiration date out that long.
-
Fucking up currency display and/or calculations is certainly not beyond them.
All Telcos are incompetent in some way, especially the big ones.
-
All Telcos are incompetent in some way, especially the big ones.
Classic case: VerizonMath.
-
I had a friend who used to write the amount of his rent check in the format "only five hundred and not a penny more" instead of no/100
-
We also have jokes about Belgians in much the same way the English have jokes about the Irish.
-
Racists.
-
So the USians don't have jokes about Mexicans or Canadians?
-
So the USians don't have jokes about Mexicans or Canadians?
We Americans have Canadian jokes but they're boring.
-
-
-
-
“one euro five” meaning not one euro and five cents, but one euro and fifty cents
Burn!
Burn in fire!!!
the lingo, not the speaker
-
Everything they do is right, except their methods of keeping their colonies.
-
We still have enough that the sun always shines on a Union Flag somewhere ;)
-
Same here, unless it's a new moon.
Of course, that flag probably lost its colors a long time ago.
-
Yes, but we don't need to use the Moon as a reflector
-
Our states are as big as your countries.
So, I have no problem with you borrowing the sun, once and a while.
-
Of course, that flag probably lost its colors a long time ago.
It's also not marking your territory, since no country is allowed to lay claim to the Moon. The sun literally never sets on the British Empire
-
The sun literally never sets on the British Empire
Of course, it's also always set on the British Empire.
-
That means we can get some sleep any time of the day then
-
That means we can get some sleep any time of the day then
You, maybe. I'm a chronic insomniac.
-
I fall asleep nearly immediately, snore like a buzzsaw for 8 hours and only wake up when my fiancee prods me for being too noisy
-
I fall asleep nearly immediately, snore like a buzzsaw for 8 hours and only wake up when my fiancee prods me for being too noisy
My mum's like that. I was sharing a hotel room with her the second half of last week. I haven't slept so little since the week my dissertation was due.
-
The sun literally never sets on the British Empire
It's after 5pm somewhere in the British Empire!
-
@Jaloopa said:
The sun literally never sets on the British Empire
It's after 5pm somewhere in the British Empire!
BTFY
-
Except we don't drink cups of nuclear waste