Let's count now: 10, 11, ... 19, 22, 6, 7
-
http://www.homedepot.ca/catalog/electric/173425+4294379628/24/0/P_OfferPrice|0
We've all seen it before... numbers that are stored as strings instead of numerically. But you would think that a major retailer would be able to sort prices properly on their web site... sheesh.
I just picked one category above that would show the sorting all on one page. I was looking through the ranges section last night and I couldn't believe there were none listed under $1000 (CAD). After lots of filtering down and jumping between pages I realized why...
-
This thing follows you around
"Yes please, CAN YOU FUCKING SORT YOUR SHIT CORRECTLY!?"
-
numbers that are stored as strings instead of numerically
Better than strings stored as number because they kinda fit the format.
My database has a
xxx.xx
identifier (where the part after the period is a sub-ID - sorta like chapter-subchapter numeration) stuffed in aDECIMAL(18,2)
...
-
I don't know, somehow I feel like:
- Hello
9999999999999999. Hello
9999999999999999999999999999999999999999999999999999999. Hello
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999. Hello
is worse.
After all, consider the hypothetical situation:
Name the first number that pops into your head!
- How's that!
999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999. Yep, still dumb.
- Hello
-
My tv sorts channels like strings, even though it displays them with leading zeros. So 001, 010, 011, 012, 002, 020, etc.
-
Clearly it should sort Discourse-style! What, your TV channels go 3, 6, 8, 10, 12? Now they go 1, 2, 3, 4, 5! And don't match up with what the people say in the news!
-
At least in Australia string sorted channels sort of makes sense: channels x, x0-x9 and x00-x99 all appear to belong to the same pre-digital station, approximately.
For example abc is on channel 2 and abc2 is on 22. Channel 10 is on 10 and their new channels are 1 and 11. But those are on 50, 51 and 55 respectively in some areas, still with the same marketing names...
-
CAN YOU FUCKING SORT YOUR SHIT CORRECTLY!?"
Not only that, when I request a sort (not this site [CBA look], but it is becoming an increasing trend on a lot of sites) - I DON'T WANT PAGES OF "SPONSORED" ITEMS AT THE TOP OF THE LIST, IT SORT OF DEFEATS THE SORT.
-
My database has a
xxx.xx
identifier (where the part after the period is a sub-ID - sorta like chapter-subchapter numeration) stuffed in aDECIMAL(18,2)
...What? That's the wrong way to do it???
Incidentally, our database has something similar for the same kind of purpose, but the numbers are integers of the format
a*1000+b
, which would be 18002 in your example.And then it was extended to a 3-part code with millions + thousands + ones, where the millions part is the type of item to be stored and the other two remain as the heading/sub-heading number. And if you think that the type of the item would be somehow unrelated to the heading/sub-heading, you are forgetting that they are all just enumerations of something or other, right?
-
-
-
What? That's the wrong way to do it???
You need to go beyond 99 - your design blows up. You need a sub-sub-heading - your design blows up even worse. You don't set the zero-padding right -
xxx.70
becomesxxx.7
. You forget to set locale - your period occasionally becomes a comma, and you get spaces, periods or apostrophes in your heading.
-
@quijibo said:
What? That's the wrong way to do it???
You need to go beyond 99 - your design blows up. You need a sub-sub-heading - your design blows up even worse. You don't set the zero-padding right -
xxx.70
becomesxxx.7
. You forget to set locale - your period occasionally becomes a comma, and you get spaces, periods or apostrophes in your heading.Hah!
I guess the integer approach is not quite as bad than the decimals because of the padding issue then.
-
Isn't the decimal data type just an integer with a constant power-of-ten divisor?
-
Is it a finite-precision type or an arbitrary-precision type?
-
I assume finite because otherwise DECIMAL(8,2) would have no reason to have those numbers bolted on.
-
They might just be there for syntactic backward compatibility…
-
Reminds me of the "Ich habe arte umgelegt" ads.
Took me a while to understand that one - the similar Dutch phrase "Ik heb Arte omgelegd" translates as "I have killed Arte"
-
"umlegen" can be a metaphor for killing in German, too, actually!
Well, that and putting something elsewhere - like a channel to a different button.