News for hackers. Stuff that matters.
Re:The number input is the worst input by kilian on Thursday September 15, 2022 @11:39AM (#32853708)
My personal pet-peeve is devs using the number input for things that contain digits but aren't "numbers" (credit card numbers, 2fa codes, postal codes etc)[0]. Number input provides a lot of footguns and you're usually better off using something else.

[0] https://kilianvalkhof.com/2022/css-html/are-you-sure-thats-a...

Re:The number input is the worst input by xxr on Thursday September 15, 2022 @01:20PM (#32855346)
A former employer had a system that consumed phone calls from Twilio. The phonecall table had a touchtoneinput column for the sequence of digits a caller pushed after the call connected (press 1 for English, press 3 to dispute a charge, etc.). We would sporadically get these query errors on inserts--turned out the touchtoneinput column was defined as a bigint, and the rare occasions where a caller pressed the # or * keys were sending input that obviously could not be parsed as an integer.

Good rule of thumb: if a reasonable person calls it a number, but your application is never going to perform arithmetic on it[0], it should probably just be a string.

[0]: Yes, a credit card number can be checksummed, but that's more in the sense of a CC# being a sequence of numbers rather than one int.

Re:The number input is the worst input by londons_explore on Thursday September 15, 2022 @02:01PM (#32855986)
There are actually 4 more touch tones possible - A, B, C and D.

Sometimes you can get into secret menus if you play the tones for them...

Re:The number input is the worst input by jbverschoor on Thursday September 15, 2022 @05:28PM (#32858697)
How do I enter these from an iphone? Or should I just let my laptop output the dtmf tones?

I'm def. gonna try this out. I usually pres & and # a couple of times, because it often skips the useless menus and takes me to a person

Re:The number input is the worst input by Someone on Friday September 16, 2022 @11:13AM (#32867154)
Historically, you whistled them (https://en.wikipedia.org/wiki/Phreaking), or you bought a hardware ‘whistle’ from the likes of Steve Jobs (https://en.wikipedia.org/wiki/Blue_box)
Re:The number input is the worst input by dmd on Friday September 16, 2022 @12:51PM (#32868843)
If you can whistle two tones simultaneously (the D in DTMF means dual), I'd love to hear it.
Re:The number input is the worst input by Someone on Friday September 16, 2022 @04:35PM (#32871694)
Re:The number input is the worst input by sshine on Thursday September 15, 2022 @05:36PM (#32858784)
> should I just let my laptop output the dtmf tones?

Yes. Depending on your OS, it might even have the sound files:

https://osxdaily.com/2016/03/31/play-dtmf-tones-mac/

Re:The number input is the worst input by jbverschoor on Thursday September 15, 2022 @05:55PM (#32858958)
Cool!, but that doesn't include ABCD.

https://pbxbook.com/other/dtmftone.html does. I'll try a company I know takes at least 40 minutes usually :

Also, something that annoys me about VOIP is that they don't take into account the different tones in different regions. Here in the Netherlands we use 425Hz fo dial tone etc. It always feels very emulated because it's a different tone.

Re:The number input is the worst input by hnuser123456 on Thursday September 15, 2022 @06:33PM (#32859291)
I've found pressing 0 or 1 usually works too
Re:The number input is the worst input by staticassertion on Thursday September 15, 2022 @02:31PM (#32856405)
First thing I do when I call an automated line is spam # because that seems to escalate to a human 9x/10.
Re:The number input is the worst input by JadeNB on Thursday September 15, 2022 @03:12PM (#32857096)
I've noticed a lot more evil choose-your-own-adventure phone menus these days resort to "Sorry, I couldn't understand" / "Sorry, I still couldn't understand" / "Sorry, your input could not be processed. Goodbye."
Re:The number input is the worst input by 9dev on Thursday September 15, 2022 @04:50PM (#32858265)
Yep, ye tricks of olde like repeatedly saying „help“ or „customer service“ don’t seem to work on those… i recently dealt with an especially frustrating case when moving and buying a brand-new fiber connection. Turns out, they got the activation date wrong, so I called the support hotline mentioned in the confirmation mail. The menu prompted me for my customer ID - which I didn’t yet have - and wouldn’t let me through, even after trying all possible options. In the end, I just called the sales hotline and let them handle the transfer…
Re:The number input is the worst input by JadeNB on Thursday September 15, 2022 @05:13PM (#32858535)
I particularly hate the ones that just hang up if you guess wrong three times.
Re:The number input is the worst input by cableshaft on Friday September 16, 2022 @08:57AM (#32865477)
Yep, we had a few IVRs set up like that for clients at an old job. The reality was there for those was that there was no pool of agents we could transfer those calls to, it was set up to be an entirely automated system by request from the client.

It was mainly for doctor appointment reminders, though, so hopefully those called still had their appointments written down somewhere (or also signed up for email reminders).

Re:The number input is the worst input by kirse on Thursday September 15, 2022 @06:37PM (#32859334)
My thumb rule is always dial the number where the company hopes you'll be handing over money, rarely fails to get me faster to a person who can help or transfer. Schedule appointment, Re-order Supplies, and Billing Questions are always much better than the Cancel service or Tech Support
Re:The number input is the worst input by mcintyre1994 on Friday September 16, 2022 @04:19AM (#32863551)
Do they not just say they'll forward you to the right department and drop you into a hold queue though? I've done this a few times when the support department had a broken automation flow and it got me to the queue, but the people at the well manned department didn't actually do the support for me.
Re:The number input is the worst input by Doxin on Monday September 19, 2022 @09:33AM (#32898077)
Generally phone systems like that are set up so forwarded calls jump the queue. This is to avoid people getting stuck in a queue for a long time twice.
Re:The number input is the worst input by idiotsecant on Thursday September 15, 2022 @04:05PM (#32857765)
You're usually better off letting the IVR route you to the first dialogue tree option at least before you start spamming, otherwise you get the 'idiots who can't listen to dialogue tree' receptionist who has to transfer you to someone else anyway but might not get you to the right place on the first try.
Re:The number input is the worst input by eastbound on Friday September 16, 2022 @02:59AM (#32862991)
I’ve once skipped “Search your problem through our docs” and clicked “Call Support” only to be told off like a pupil that I didn’t read the docs, really like a kid.

It surprised me coming from Apple Business Manager. It was unprofessional. Don’t skip the docs, guys!

Result: As expected, my problem wasn’t solved by following their 18-step DUNS/Apple process during the last 8 month. (My problem: My company changed both address and name, they still have both addresses with the old one as primary).

Re:The number input is the worst input by staticassertion on Thursday September 15, 2022 @08:14PM (#32860268)
I'm fine with getting the router human.
Re:The number input is the worst input by kstrauser on Thursday September 15, 2022 @03:37PM (#32857419)
I've, um, heard, that more sophisticated phone trees react to profanity by connecting you to a person more quickly, using the logic that you sound pretty upset and need help now.
Re:The number input is the worst input by inopinatus on Thursday September 15, 2022 @06:50PM (#32859465)
I ran a network & voice refresh project for a national financial institution a few years ago; during the RFT some vendors pitched a stress analysis element for the contact center & IVR systems. The institution demurred, citing (amongst other concerns) the likelihood of it being gamed.
Re:The number input is the worst input by kstrauser on Friday September 16, 2022 @02:23PM (#32870085)
It's probably smart for a few reasons. Given limited support resources, do you really want to spent all of them on furious people? If it takes five times as long to help one irate customer with a complex situation, at some point that has to enter the calculus.
Re:The number input is the worst input by cableshaft on Friday September 16, 2022 @08:50AM (#32865411)
Can confirm I had grammar for testing for various profanity and took that into consideration for whether to send to customer service in the IVR apps I developed.

The client really didn't want people sent to live agents if at all possible, as they only had a certain low number of agents and wanted to keep it that way, so we had extra prompts that tried to convince the user to give the app a try first before we did a transfer to an agent, but it was something that could start the process off.

And this was an IVR app for a Fortune 500 corporation, not a small company.

Re:The number input is the worst input by dexterdog on Thursday September 15, 2022 @11:59PM (#32861895)
What about the sophisticated ones that say, "listen to all or of options as out menu has recently changed." When you call back two years later the message is exactly the same. Why don't they make call handling software that has the menu items assigned to random numbers so that the menu is always different?
Re:The number input is the worst input by stormbrew on Friday September 16, 2022 @12:17AM (#32862003)
I think this and "higher than usual call volumes" are really just about plausible deniability. Anyone who's worked retail will have a story about someone who insists that the thing they're buying was cheaper last week even though it wasn't. Telling people up front that things have changed probably at least sometimes defuses that conversation one way or another before it even happens.
Re:The number input is the worst input by AngeloR on Tuesday September 20, 2022 @12:53PM (#32914488)
If you have the option of having dual-language queues then you can also opt to the secondary language which generally has fewer callers than the primary. So you get to the front of the line faster, and they also tend to speak the primary language.
Re:The number input is the worst input by ajg36 on Friday September 16, 2022 @09:28AM (#32865795)
Interesting; I'll have to try this. In my experience pressing 0 has a decent chance of working as a shortcut to a human operator (versus choose-your-own-adventure DFS searching for the right node in the menu tree, which can take ages), but obviously it doesn't work when they don't have human operators at all.
Re:The number input is the worst input by yarg on Thursday September 15, 2022 @11:31PM (#32861737)
Certainly not an Integer, but all that you're saying when you go with String is that the data has no constraints at all.

There's almost always a regular language more constrained and useful than .* that contains the entire set of acceptable terms (although sometimes it'll be a strict superset, in which case DFA acceptance cannot constitute complete validation).

Re:The number input is the worst input by stormbrew on Friday September 16, 2022 @12:14AM (#32861985)
When humans do the input there is often not a single regular language that works, and imposing only one will often frustrate a lot of users.

A really small example of this is postal codes in Canada. For a long time the norm was to put a hyphen between the two clusters: A1B-2C3 but then at some point a lot of websites decided that's bad and they started rejecting it, often with really obtuse messages. This is just annoying and no one is really well served by it. Canada post doesn't care.

And that's not even getting into 0 vs O and the fact that yelling at the user for entering the wrong one is rarely helpful.

I think most of the time the better thing to do is attempt to normalize and ask the user if the normalization is correct. For a numeric thing like a phone number this is probably stripping out non-numbers (other than + at the start) and putting hyphens back in and validating the number of digits you get back, and presenting it to the user if it differs. More work but feels way less hostile to the user.

Re:The number input is the worst input by jenny91 on Friday September 16, 2022 @12:21AM (#32862032)
The regular language should include the fact that you might include a dash between those sets of numbers, e.g. "A1B-2C3".

I really can't think of any case where changing a "0" to an "O" is a good idea (or vice versa), except like base 58 whre you're explicitly avoiding both.

Either way if you're going to normalize you need a regular language, so I think you're kinda missing the point here on what regular languages mean in this context?

Re:The number input is the worst input by stormbrew on Friday September 16, 2022 @12:38AM (#32862138)
That was just a simple example. If you take addresses as a whole, it gets a hell of a lot more complicated. I do agree that you can just `[ -]` in the middle of that one, but simple examples are simple. Also, it's telling that very few sites actually do this.

The real point is that you want to have one regular form for the input in your database, but imposing that one that you prefer on your users creates friction when their experience of the world differs.

As for 0 vs. O, in a Canadian postal code it doesn't matter, because there is indeed a very regular language to them: letters alternated with numbers. A round circly thing in a numeric position is a 0 and a round circly thing in a letter position is an O. No matter what. The only time this actually indicates a problem is if the pattern ceases to hold after the round circly thing, in which case it may or may not be the 0/O confusion that's the problem but it was wrong anyways.

I'm not saying you should store it wrong, but if a user enters "HOH-OH0" and you ask "did you mean 'H0H 0H0'?"[1] and they say yes then you've given the user a much better and helpful flow than "Invalid Postal Code, please fill out the form again."

[1] This is a 'real' postal code btw and it goes to a weird santa-letter black hole even though it doesn't indicate a geographical location that corresponds to the north (an H prefix is for Montreal).

Re:The number input is the worst input by themenomen on Thursday September 15, 2022 @02:34PM (#32856451)
Mayor issue here seems to be not validating and sanitizing inputs before a DB insert.
Re:The number input is the worst input by nightpool on Thursday September 15, 2022 @02:49PM (#32856723)
Or not even being able to log errors and see what the error message says. You don't need to do ahead-of-time sanitization to realize that "Invalid literal for type 'bigint': "120380123#"" means that you should fix your DB type.
Re:The number input is the worst input by xxr on Friday September 16, 2022 @03:12PM (#32870683)
>being able to log errors and see what the error message says

A faculty that was, of course, lacking at this particular organization

Re:The number input is the worst input by jbverschoor on Thursday September 15, 2022 @05:26PM (#32858673)
A string of digits instead of a string of characters to be precise
Re:The number input is the worst input by cafard on Thursday September 15, 2022 @01:42PM (#32855720)
Years ago, a report somebody had built for us blew up on some addresses in the Midwest. A look at the addresses showed values of the form "12345E State Road 5". The control that read the house number interpreted as a number in scientific format, and of course had no provision for a number that large. Dropping a space in before the "E"s allowed the report to run.

This is an odd case, in that the house number is a "number": in the US it generally indicates distance from some fixed line, and the parity can indicate which side of the street it falls on. But then people will write them with As, Bs, Es, etc. attached.

Re:The number input is the worst input by kube-system on Thursday September 15, 2022 @01:48PM (#32855807)
If something is sometimes a number, then it’s not a number. Address numbers in the US are just identifiers that use digits, and sometimes they are derived from some other factor that is a (or multiple!) number.
Re:The number input is the worst input by muti on Thursday September 15, 2022 @07:10PM (#32859673)
Good place to drop the fantastic "falsehoods developers believe about addresses" [0]

And my favourite case of interesting address numbers in the US, menomonee falls, which includes addresses such as "W162N7420 Tamarack Trail" [1]

0: https://www.mjt.me.uk/posts/falsehoods-programmers-believe-a...

1: https://goo.gl/maps/J8s2yMKConwJMg727

Re:The number input is the worst input by nijave on Thursday September 15, 2022 @05:34PM (#32858758)
In the U.S. it's possible "12345E State Road 5" and "12345 E State Road 5" are different addresses depending on if the streets have directional suffixes and how they're interpreted (east and west)

I'm not sure how mail carrier software works, but in general there's a lot of variations of the same address that still lead to mail getting delivered correctly (and some addresses where the mail can't be delivered at all)

For U.S. apartments, usually any of these work "123A Some St" "123 Some St #A" "123 Some St Apt A" "123 Some St Unit A"

Re:The number input is the worst input by ramesh31 on Thursday September 15, 2022 @07:03PM (#32859600)
>I'm not sure how mail carrier software works, but in general there's a lot of variations of the same address that still lead to mail getting delivered correctly (and some addresses where the mail can't be delivered at all)

USPS has a canonical list of all valid addresses. In most cases of hand written letters, it comes down to a human’s judgement call.

Re:The number input is the worst input by jholman on Friday September 16, 2022 @02:19PM (#32870030)
Canada Post also has a canonical list of all valid addresses.

I live in an apartment, let's say unit 555 at 123 Main St, and my canonical address has the form 555-123 Main St. This is not unusual in any way.

It is vanishingly rare to find a business, software, or customer service agent that is willing to enter this address correctly, even when dealing with my provincial government or my federal government. They always want to put "Apartment" or "Unit", or move the apartment number after the street, or some other transformation.

Re:The number input is the worst input by Aloha on Thursday September 15, 2022 @06:43PM (#32859406)
Also - 12345 State Road 5 E and 12345 E State Road 5 E, and 12345E State Road 5 E
Re:The number input is the worst input by vsareto on Thursday September 15, 2022 @01:56PM (#32855920)
Someone should write a bot to post a reminder to "start with strings unless you're doing math" to reddit/twitter/youtube every week and the world would probably be way better for it. We could even have compiler warnings for type-safe languages when someone declares an int with a name containing 'address/zip/postal/credit/card'
Re:The number input is the worst input by r-w on Thursday September 15, 2022 @02:49PM (#32856719)
> We could even have compiler warnings for type-safe languages when someone declares an int with a name containing 'address/zip/postal/credit/card'

That sounds like it would be a better job for a linter than for a compiler.

Re:The number input is the worst input by gibolt on Thursday September 15, 2022 @04:07PM (#32857796)
Why not both! Not everyone uses a linter (unfortunately). Compiler would be a nice second catch (for any tooling that has a compiler)
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @03:18PM (#32857177)
"start with strings unless you're doing math"

lambda calculus tells us, stick with strings even when you're doing math

Re:The number input is the worst input by LoganDark on Saturday September 17, 2022 @03:45AM (#32875564)
With lambda calculus you don't need strings
Re:The number input is the worst input by gregmac on Thursday September 15, 2022 @03:12PM (#32857082)
> But then people will write them with As, Bs, Es, etc. attached.

This is fairly commonly used for multi-unit dwellings, especially when someone turns a "normal" house (with a purely numeric street address) into multiple units, including renting out their basement.

In subdivisions the houses are often consecutive numbers (with odd/even numbers on opposite sides of the road), and it's not like the city is going to re-number every other house on the street.

Re:The number input is the worst input by sophacles on Thursday September 15, 2022 @03:41PM (#32857477)
This is also often how you end up with 1/2 addresses - a lot is split and rather than renumber the block, they have one of the lots keep the original and the gets (e.g.) 408 1/2.

And that's why I have a home address that doubles as an input fuzzer.

Re:The number input is the worst input by Doxin on Monday September 19, 2022 @09:42AM (#32898172)
House numbers are not numbers in plenty of cases. Youy'll probably want to account at least somewhat for international addresses too, since most companies end up dealing with them sooner or later, if only to tell the customer you won't ship there.

I run into this sort of thing somewhat frequently. A multinational food delivery company here had a period for a couple years where it'd parse "1st whateverstreet 123" as an address on whateverstreer with the number "1st", dropping the 123 entirely. This may seem a bit silly but keep in mind that over here "123 Annex B" is a valid house number for instance, which might be a different building from "123B".

Re:The number input is the worst input by code_duck on Friday September 16, 2022 @03:09AM (#32863061)
I had problems with practically every form that had an address entry when I had an address that was “State Road <number>”. Most validators interpret that as a road called State Road and reject the number. This also caused problems when I was telling my address to people on the phone who were apparently entering it into a form. The road had no alternate name and “Highway 142” didn’t work either.
Re:The number input is the worst input by cafard on Friday September 16, 2022 @06:38AM (#32864386)
Quite so. Not far outside Cleveland, Ohio, is the "Parma Triangle" formed by State Road, Pearl Road, and Snow Road. Is State Road a state road? I don't know.
Re:The number input is the worst input by gherkinnn on Thursday September 15, 2022 @02:26PM (#32856323)
My personal pet-peeve is when devs use any sort of numerical type for things that don’t require numerical operations.

I will never sum up a list of phone numbers, nor will I ever divide my CC number by two.

They’re strings that just happen to be made up of numbers.

Re:The number input is the worst input by staringback on Thursday September 15, 2022 @02:29PM (#32856371)
https://en.wikipedia.org/wiki/Luhn_algorithm

Credit card numbers are used with numerical operations

Re:The number input is the worst input by MBCook on Thursday September 15, 2022 @02:37PM (#32856514)
That’s a checksum algorithm. You could easily devise something similar for a word based on the characters in it. That doesn’t make it a number.

GP is right. You never do math with two credit card numbers as inputs. You can’t negate a credit card number, or find its absolute value, or square, etc.

It’s just a string of digits.

Re:The number input is the worst input by thechao on Thursday September 15, 2022 @03:06PM (#32856986)
To reiterate your statement: it's a string with constraints on the glyphs!
Re:The number input is the worst input by staringback on Thursday September 15, 2022 @04:38PM (#32858133)
Did you even read the wikipedia page I linked?

    If the number already contains the check digit, drop that digit to form the "payload." The check digit is most often the last digit.
    With the payload, start from the rightmost digit. Moving left, double the value of every second digit (including the rightmost digit).
    Sum the digits of the resulting value in each position (using the original value where a digit did not get doubled in the previous step).
    The check digit is calculated by 10 − ( s mod ⁡ 10 ) {\displaystyle 10-(s\operatorname {mod} 10)} {\displaystyle 10-(s\operatorname {mod} 10)}.
Re:The number input is the worst input by colejohnson66 on Thursday September 15, 2022 @04:53PM (#32858303)
I think what GP is saying is: Just because it is a number (that has a checksum built on it being a number), does not mean most programmers should treat it as one; Treat it as an opaque string. If you need to validate it, use a character by character (not digit by digit) Luhn algorithm; Work on ASCII digits, not numbers.

The issue is that many beginner (and some experienced) programmers treat what should be opaque strings as numbers and throw them into a 32/64-bit integer, or worse, a double precision float (in JavaScript). This can result in data corruption if not done carefully. Then, when something comes in to challenge the programmer's expectations, the program breaks. For example, ZIP/postal codes are 5 numeric digits in the US, but in CA, they're of the form "A1A 1A1" (notice the space and letters). JavaScript's `parseInt` will return NaN on a Canadian postal code. Another one is house numbers; They look numeric, but can have letters or even fractions(!) in them.

Re:The number input is the worst input by pphysch on Thursday September 15, 2022 @06:31PM (#32859275)
The first line is revealing; "contains" is not an operation usually performed on numbers.

Does the number 21 "contain" the number 2? Not in a meaningful sense.

However, the string "21" definitely contains the substring "2".

Re:The number input is the worst input by eyelidlessness on Thursday September 15, 2022 @08:19PM (#32860304)
I’m not sure how it’s taught now, or how it might vary by teaching method, but the way I learned multiplication and division definitely treated the number 21 as “containing” the digit 2. I agree with the conclusion that a CC identifier should be treated as a string, but I don’t find this reasoning to be a compelling argument for that conclusion.
Re:The number input is the worst input by kalleboo on Friday September 16, 2022 @01:47AM (#32862550)
It contains the digit 2, but not the number 2. It's a string of digits, not a singular number.
Re:The number input is the worst input by MBCook on Friday September 16, 2022 @08:32AM (#32865255)
But that’s the difference isn’t it? In a number each digit represents groups of powers of ten. The number of hundreds, thousands, etc in the number.

The digits in a credit card number are meaningless. They have no relation to each other. If you choose two digits next to each other one doesn’t represent groups of 10x as much as the other digit. Or any other quantity.

The digits are effectively just symbols, not quantities like in a mathematical representation.

Re:The number input is the worst input by zmgsabst on Thursday September 15, 2022 @04:58PM (#32858376)
That excerpt is clearly describing operations on the digits that compose the string and not arithmetic on the CC number as a single integer.
Re:The number input is the worst input by jameshart on Thursday September 15, 2022 @08:25PM (#32860350)
the digits you parse out of a credit card number are used in a numerical algorithm. That's not the same thing at all.
Re:The number input is the worst input by lucas_membrane on Friday September 16, 2022 @04:28AM (#32863601)
Vehicle identification numbers, which follow an international standard, also have a check digit, even though they contain alphabetic characters.
Re:The number input is the worst input by jameshart on Friday September 16, 2022 @07:14AM (#32864597)
ISBN codes too - checksum is base 11 so can be represented by a digit 0-9 or an ‘X’ in the final place.
Re:The number input is the worst input by madeofpalk on Thursday September 15, 2022 @03:24PM (#32857266)
The most infuriating part about number input, is when you set min=0, you can't backspace in the field to enter a different number.
Re:The number input is the worst input by Zardoz84 on Friday September 16, 2022 @02:24AM (#32862774)
I don't see that behavior on Firefox and Chromium ... What browser dos that ?
Re:The number input is the worst input by triceratops on Thursday September 15, 2022 @03:10PM (#32857049)
Stupid question. If you don't use input[number] on such fields, how do you get a number keypad input on mobile keyboards for them? It's annoying, as a user, to switch to numbers and use the tiny row of numbers to enter credit card info.
Re:The number input is the worst input by neon_electro on Thursday September 15, 2022 @03:35PM (#32857398)
Not a stupid question! I believe CSS Tricks has your back.

https://css-tricks.com/finger-friendly-numerical-inputs-with...

Re:The number input is the worst input by xboxnolifes on Thursday September 15, 2022 @03:22PM (#32857238)
type=text

inputmode=numeric

Re:The number input is the worst input by dhritzkiv on Thursday September 15, 2022 @03:26PM (#32857290)
This.

Further, for credit cards, you can add `autocomplete="cc-number"` to the input and it will provide platform-specific UI for pre-filling the credit card number.

Re:The number input is the worst input by triceratops on Thursday September 15, 2022 @03:26PM (#32857281)
Thank you!
Re:The number input is the worst input by hbn on Thursday September 15, 2022 @01:31PM (#32855521)
My credit card number is three quadrillion, five hundred and twenty-eight trillion, nine hundred and seventeen billion...
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @03:20PM (#32857213)
just as a bit of trivia, not sure where this even comes from, Dickensian counting houses? but you're not supposed to put the word "and" in there, just strip it out; say "and" when you get to the decimal point
Re:The number input is the worst input by kccqzy on Thursday September 15, 2022 @04:02PM (#32857736)
The "and" after "hundred" is just standard British English. American English omits that "and" though.
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @04:15PM (#32857883)
but it makes an actual difference in unambiguous comprehension, like the Oxford comma.

"one hundred seventeen" vs "one hundred and seventeen" are different, 117 vs 100.17

"twenty three eights" vs "twenty and three eighths" are 23/8 vs 20 3/8.

I don't know why this idea is upsetting to people.

https://www.grammar-monster.com/lessons/numbers_how_to_write...

Re:The number input is the worst input by kaashif on Thursday September 15, 2022 @05:37PM (#32858798)
This is surprising to me because as a British person living in the US, who is familiar with British and American English, I've never once heard anyone use "and" to mean a decimal point. Literally never. The first time I'm hearing about it is from your comment.

I even found this article about how "and" doesn't actually mean decimal point: https://www.grammarphobia.com/blog/2012/02/decimal-point.htm...

Re:The number input is the worst input by eyelidlessness on Thursday September 15, 2022 @08:26PM (#32860357)
It’s a distinction I remember from (American) childhood (I’m ~40) but I think even then it was viewed as pedantic and falling out of common usage. I don’t think either is “right” even if I take a prescriptivist approach, but even if I’m not aware of it I do tend to favor omitting non-decimal “and” in my own usage in hope it’s less ambiguous.
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @06:21PM (#32859192)
just because you haven't heard of something doesn't mean it doesn't exist.

I think it dates from the time when the only decimals the average person would use were in currency.

Re:The number input is the worst input by Loocid on Friday September 16, 2022 @03:46AM (#32863314)
And just because it exists, doesn't mean it's "right".

Your link is the only one I could find on the first page of google that states "and" means decimal point. Every other source I could find says "100.17" is either "one hundred point one seven" or "one hundred point seventeen".

Re:The number input is the worst input by jimjimjim on Thursday September 15, 2022 @04:19PM (#32857936)
most english speaking countries apart from the us (and canada?) say and. Are you saying they are wrong and you are right?
Re:The number input is the worst input by dwringer on Thursday September 15, 2022 @04:35PM (#32858097)
I'm not sure where "one hundred and seventeen" would mean 100.17. To me, as someone from the US, it unambiguously means 117. I probably wouldn't use the "and" myself, but it makes no difference in interpreting the numbers. To say 100.17, I would say "and 17 hundredths", not just "and 17" (17 what?).
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @07:37PM (#32859933)
imagine you are reading lists of currency amounts off to another person across the room going over ledgers. It's an easy shorthand to adopt to compress more information into the bandwidth. And if you adopt it as a way of speaking every day, you don't need to talk about it any more.

I think people are forgetting, before the days of numeric calculation by machines, there were rooms full of people tasked with keeping track of these things.

Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @04:52PM (#32858289)
I'm not saying "I'm right", I'm saying "this is a system I was taught, the system pre-existed me, and I thought an intellectual website that obsesses over the history of small details and unambiguous communication protocols would appreciate my contributing it."

back when we wrote checks, you didn't write the word "and" till you got to the cents (US) on a line that was preprinted "dollars": one hundred fifty three cents dollars" vs "one hundred fifty and three cents dollars".

It's history, it's interesting, it's not meant to throw you into a panic or fits of anger. And I very much doubt that you speak for all of English speaking countries, and through history as well, but must admit you might and I'm lucky to encounter an historian of numerical orthography.

Re:The number input is the worst input by macintux on Thursday September 15, 2022 @05:05PM (#32858445)
I can’t speak for everyone, but I’ve never in my 50+-year-life had someone express in American English “and” while referring to a decimal point.

(Update: unless the units were expressed after the following number, like 5 dollars and 13 cents, which still wouldn’t express a decimal point.)

Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @07:45PM (#32860021)
like 5 dollars and 13 cents, which still wouldn’t express a decimal point

it doesn't express a decimal point if you think of cents as a completely different unit of currency from dollars, but if you think of cents as 1/100ths it actually does indicate the decimal point. "5 dollars and 13 100ths" which is what cents means, and which is sometimes used when not referring to money, for example items that are measured in centiles such as interest rates. I think our forebears were more likely to throw words like centile around, and thats how they came up with the word cents.

My cousin is Italian and he always says "for cent" to me and I scratched my head till I realized, per is translated to for from Italian, and they say "25 per cento" so he's just translating it to English as it makes sense to him, not realizing we also have the word per.

Re:The number input is the worst input by chrismorgan on Friday September 16, 2022 @01:17AM (#32862381)
Your cheques example is a completely different matter because you’re specifying a unit, without which it would be nonsensical in at least most English locales (all that I know of). That dividing “and” in {{N dollars} and {N cents}} is just a normal “and” like any other in English, roughly meaning “plus”. In Australian English, I would pronounce $1,234,567.89 as “one million, two hundred and thirty-four thousand, five hundred and sixty-seven dollars and eighty-nine cents”.

For more interesting currency matters, go back to https://en.wikipedia.org/wiki/£sd#Writing_conventions_and_pr..., where you had three items, and “£2/4/6” would typically be pronounced “two pound, four and six” (or sometimes “two pounds, four shillings and sixpence”). This shows more clearly that what it’s a perfectly normal “and” like any other in English. (Also that conventions can certainly allow elision in understood contexts. I’ve never heard of “one dollars and twenty-three” for “$1.23”, but it would be consistent with the sorts of shortenings that sometimes happen.)

Re:The number input is the worst input by jimjimjim on Thursday September 15, 2022 @05:17PM (#32858571)
my tone was probably a bit blunt. It seems to be a stimulus-response in me when regional differences in language, date formats or units of measure are presented as being wrong rather than just different.
Re:The number input is the worst input by fsckboy on Thursday September 15, 2022 @07:35PM (#32859917)
the sense in which one way is "wrong" is the same sense in which the oxford comma is argued: nobody is saying that civilization will collapse either way, but one way is tighter in terms of eliminating more common forms of ambiguity. And when saying 150 is one hundred and fifty, the "and" adds nothing in terms of information or comprehension; to that very same person, "one hundred fifty" is just as comprensible.

and fwiw, I don't think it's a regional difference, I think it's a difference between certain traditions within the banking and accountancy areas, vs outside.

Re:The number input is the worst input by airstrike on Thursday September 15, 2022 @03:36PM (#32857412)
the "and" is there in other languages so maybe it's just a translation oversight ;-)
Re:The number input is the worst input by rwky on Thursday September 15, 2022 @01:52PM (#32855861)
Funnily enough I just dealt with this scenario today. I had to fix a database which was storing phone numbers in an int column. The phone numbers start with a 0 so no surprise querying it didn't work! It's now a string.
Re:The number input is the worst input by dspillett on Friday September 16, 2022 @05:05AM (#32863855)
Some years ago we had fun with a client who had systems that insist staff reference numbers are zero-padded, but users like processing data via Excel before uploading for us to import or otherwise process. Even just opening and accidentally saving (habit, accidental change followed by undo with enough time between for auto save to kick in, etc) when intending just to open to inspect, will step the leading zeros off in a CSV. So all code dealing with their manual inputs or bulk imports needs to be aware that those codes may or may not have leading zeros so cannot be used as simple string values as they should be. For extra fun, in one case after a company merge/purchase some codes were padded to a different length so treating them as numbers or unpadded strings internally and padding with zeros for display/export/other wasn't as clear as you'd think.
Re:The number input is the worst input by inopinatus on Thursday September 15, 2022 @06:42PM (#32859387)
The tendency of spreadsheets, most notably Excel, to convert phone numbers to integers (or worse, a generic number form that it then saves in floating-point representation) has infuriated everyone that ever exported a telephone field.

Yes, there are ways to trick Excel into interpreting the value as a string. None of them are foolproof.

Re:The number input is the worst input by lattalayta on Thursday September 15, 2022 @02:30PM (#32856383)
I saw the same thing once for United States zip codes. I guess they didn't realize that the east coast has zip codes that start with 0s
Re:The number input is the worst input by at_a_remove on Thursday September 15, 2022 @04:24PM (#32857987)
Then you've got your ZIP+4 format ...
Re:The number input is the worst input by runarberg on Thursday September 15, 2022 @07:10PM (#32859669)
This advice sounds awful lot like the old school “don’t use <table>”.

It is a terrible advice, you shouldn’t use <table> for styling, but if you are representing a tabular data, by all means use <table>. I’ve heard some developers (mostly back end devs that dabble in front end) say you’re not supposed to use tables, and I’ve seen div soups where there definitely should be tables. And I blame overuse of the rhetoric “don’t use <table>”.

By all means, if your taking in a numeric value, use <input type=number>. You get frontend validation, localization, context aware soft-keyboard, accessibility etc. all for free. Use it.

If however, you don’t have a numeric value (e.g. a value that is simply represented with digits) use something else. In general, if ordering values makes sense, then most likely <input type=number> is your best choice.

Re:The number input is the worst input by IlliOnato on Friday September 16, 2022 @02:22AM (#32862759)
Hmm. The author's problem is not with <input type=number> conceptually, which would be fine if properly supported by browsers, i.e. in the ideal world.

In the real world, however, the browsers apparently a) don't prevent users from entering incorrect values b) don't allow the developer to do anything about it programmatically, by preventing access to these incorrect values (always returning empty).

The author brings attention to this problem.

Now it's up to you as a developer to decide whether the benefits of using <input type=number> outweigh the costs, but the costs are real and you need to be aware of them.

Re:The number input is the worst input by runarberg on Friday September 16, 2022 @01:00PM (#32868964)
It is supported by all modern browsers. Even IE-11 supports valueAsNumber and the most important Constraint Validation API methods to deal with the problems the author mentions.

If you want to deal with inconsistent (and possible eccentric) user input: Use input.valueAsNumber

If you want to distinguish between empty and invalid inputs: Use input.validity.valid or input.validity.badInput

If you want to programmatically deal with incorrect entries: Again use the constraint validation API.

Re:The number input is the worst input by superjan on Thursday September 15, 2022 @02:52PM (#32856769)
An easy question to ask: “would it be fine to add or remove an arbitrary number of leading zeroes?” If no, don’t put it in a number field.
Re:The number input is the worst input by chrsig on Thursday September 15, 2022 @01:47PM (#32855786)
i have an insurer who uses social security numbers as account numbers...and stores them as integers.

the developers obviously did not realize that social security numbers may start with a leading zero. (so can postal codes!)

Re:The number input is the worst input by fwip on Thursday September 15, 2022 @02:25PM (#32856311)
This can clearly cause output formatting issues, but it doesn't seem to introduce any ambiguity as they're all 9 digits.
Re:The number input is the worst input by lucas_membrane on Friday September 16, 2022 @01:55AM (#32862588)
And when you join up as covered by Medicare (usually around age 65), you get a second 9 character ID on a card that looks like a Social Security card with the hyphens in the same positions, said ID probably containing both digits and letters (not case sensitive AFAIK).
Re:The number input is the worst input by px1999 on Thursday September 15, 2022 @04:01PM (#32857716)
A bit of a side point but I'm a little amazed that using ssns as account ids is legal.

The approach just seems to be asking for identity theft/fraud...

Re:The number input is the worst input by eyelidlessness on Thursday September 15, 2022 @08:36PM (#32860440)
I’m not sure how it could be illegal. It definitely isn’t a good natural primary key (but then I’m firmly in the “natural PKs are harmful” camp anyway). And it’s certainly too easy to leak PII by using it as a PK. But I’m struggling to imagine a coherent legal structure which accepts collecting SSN data but mandates limits on how it can be used in a database schema.
Re:The number input is the worst input by somat on Thursday September 15, 2022 @06:40PM (#32859369)
Personally I am conflicted on this one.

On the one hand a ssn number(or any identifying number) should not need to be any more secret than the name it is replacing, your ssn should be able to be publicly available.

However, this is the real world and many people and institutions use the ssn as the sole source of identity, which means it needs to be kept secret.

Re:The number input is the worst input by lucas_membrane on Friday September 16, 2022 @05:13AM (#32863908)
Unfortunately, about 40 years ago, I was employed by a corporation in a capacity that required them to file documents identifying me by SSN to state regulators in several states, such documents being available for the public to inspect, not withstanding that I still have my original Social Security card, which says thereon quite clearly "Not for Identification."

The SSN does not have the attributes of a good permanent identifier of a unique person. If you get an SSN with three consecutive 6's in it, you can get it changed to another one not containing that string. Worse yet, the Social Security Administration has reserved the right to reuse the SSN's of persons deceased (IDK if they can or might do that without giving further notice). Furthermore, the US government talks as if there are two completely different kinds of numbers that each use 9 digits, and that they might overlap, ie use the same numbers for different entities; one being SSN's and ITINS, and the other EINS. However, the practice of the IRS and SSA has been to do their best to make sure that they do not overlap, at which the results have been as good as can be expected, but not perfect.

As many games have been lost by one card too many as by one card too few.

Re:The number input is the worst input by padseeker on Thursday September 15, 2022 @11:46AM (#32853815)
I actually mentioned that at the bottom of the article on how to handle the issues mentioned. Firmly agreed, using the number input for non mathematical values is a horrible idea.