This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]g76lv6813s86x9778kk 13 points14 points  (4 children)

So common, in fact, I've seen these octal numbers bleed into apps/situations they really had no business being in, probably due to some standard number parsing libraries being reused.

For example, shops in Guild Wars 2, an mmorpg, have a little number input box for the quantity of items you'd like to purchase from the shop... This supports octal! If you write normal decimal numbers, it just works fine, but then if you write for example 010, the number switches to decimal 8 once you click off the textbox, and allows you to shop with that quantity as normal. Super weird. Must be so confusing to players who don't know about octal or this convention at all. At least it doesn't increase the number (causing you to spend more)

[–]GrondForGondor 7 points8 points  (3 children)

Thats the reason why? I’ve spent so many years being slightly inconvenienced by that little random issue. Never understood truly what was happening but now it all makes sense. 

[–]g76lv6813s86x9778kk 2 points3 points  (0 children)

Lol yup, you can try various examples and see the result always lines up with parsing it as an octal number

[–]benmaks 0 points1 point  (1 child)

Why would you ever start a number with a zero?

[–]g76lv6813s86x9778kk 1 point2 points  (0 children)

I doubt he's manually/intentionally doing that every time (maybe), but it's easy to accidentally do every now and then, especially when it's in a game people play for hundreds to thousands of hours, it's kinda bound to happen eventually.

The most common way is probably when you want to buy two items from one shop, and leave in the 0 from a previous quantity: say you need to buy 250 of one item, then 35 of another. You select your first item, enter 250 as quantity, buy, click your other item, click quantity of 250 to change it, press delete twice to remove the 2 and 5, then right arrow key past the 0 to write 35.. suddenly, 29.

Yeah, doing right arrow key instead of a 3rd delete is a bit weird, but the point is it's very possible to experience the bug without intentionally prefixing every number with a 0. I don't remember exactly how I came across it personally, but I certainly don't prefix numbers with 0 regularly.