Let's count now: 10, 11, ... 19, 22, 6, 7



  • 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!?"



  • @quijibo said:

    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 a DECIMAL(18,2)...



  • I don't know, somehow I feel like:

    1. Hello
      9999999999999999. Hello
      9999999999999999999999999999999999999999999999999999999. Hello
      99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999. Hello

    is worse.

    After all, consider the hypothetical situation:

    Name the first number that pops into your head!

    1. How's that!

    999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999. Yep, still dumb.



  • 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...



  • @cartman82 said:

    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.



  • @Maciejasjmj said:

    My database has a xxx.xx identifier (where the part after the period is a sub-ID - sorta like chapter-subchapter numeration) stuffed in a DECIMAL(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? :smile:



  • @quijibo said:

    which would be 18002 in your example

    DECIMAL(18,2) is a type, just like int64.


  • area_deu

    @Zemm said:

    channel numbers

    Reminds me of the "Ich habe arte umgelegt" ads.



  • @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 becomes xxx.7. You forget to set locale - your period occasionally becomes a comma, and you get spaces, periods or apostrophes in your heading.



  • @Maciejasjmj said:

    @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 becomes xxx.7. You forget to set locale - your period occasionally becomes a comma, and you get spaces, periods or apostrophes in your heading.

    :trolleybus: 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?


  • Discourse touched me in a no-no place

    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.


  • Discourse touched me in a no-no place

    They might just be there for syntactic backward compatibility…



  • @aliceif said:

    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"


  • area_deu

    "umlegen" can be a metaphor for killing in German, too, actually!

    Well, that and putting something elsewhere - like a channel to a different button.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.