3 ms·
To put it more succinctly and without unnecessarily referring to JavaScript semantics, type="number" is for quantities, not mere strings of digits. It's an unf
by pwdisswordfish2 7y ago
To put it more succinctly and without unnecessarily referring to JavaScript semantics, type="number" is for quantities, not mere strings of digits.
It's an unfortunate accident of the English language that both are commonly called ‘numbers’. We might not have had this confusion if some other language were the lingua franca of computing.
- samatman 7y agoYou can't entirely avoid referring to JavaScript semantics here, type="number" is for values appropriate to represent and work with as IEEE 754 doubles. That covers a lot of ground, by design. But a 'number' it isn't.
- mjevans 7y agofloat, floating, double, etc would have been better choices for that type... Though 'quantity' as described in another post still sounds the best given the sub 1 and add 1 buttons.
- bobthepanda 7y agoI mean, this could've been solved by the spec using type="quantity". Many languages have generic, ambiguous umbrella terms, it's the sloppiness of the spec picking one.
- alexis_fr 7y agoA sequence of numbers could be called, with a little approximation, a barcode. Which makes me wonder why credit cards don’t have an actual barcode to easily enter it on the computer.
- jsjohnst 7y agoThe spec could’ve used type=“quantity” and there wouldn’t be as much or any confusion. Point being, blaming the language used for writing the spec, when you readily offered up a better alternative, feels misguided to me.
- pfranz 7y agoTechnically, number (a quantity) vs numbers (a series of numbers) would suffice. "Numeric" (as an input mode vs a number type) makes sense, too. I think it's just an evolution of our education, preferred input devices, and specs all catching up with each other. On a desktop I just start typing numbers from the keyboard. On a smartphone I click on a credit card field, if the field expects "text" I have to click "123" then input the number using a number row with smaller target sizes. I would greatly prefer to directly show me a number pad.
- franga2000 7y ago> We might not have had this confusion if some other language were the lingua franca of computing. Interestingly enough, I can confirm as a native speaker of one such language (🇸🇮Slovene), that outside of discrete mathematics and tech, the words are often used interchangeably. This suggest that the lack of a word in English isn't the cause but the effect. The distinction was likely not necessary before the modern era, so old (==all) languages never created/adopted proper terminology.