66

Our html:

<input type="number"/>

Accepts only numbers, so far so good. Until QA files a bug:

"Numeric input accepts the letter 'e' "

Apparently 'e' is a valid because you can input something like '1e3' which fucking means '1000' !

Our team tried to argue with the QA that 'e' is valid because it simply means exponent but they argue a normal user would not know what an exponent means because they are not "mathematically inclined"

Part of me agrees with what the QA argues but then I think an average user who could use a fucking laptop or mobile will most certainly know what an exponent is.

Comments
  • 13
    And that's why we could an html5 nput element defined by a regex and/or a validate function.
  • 8
    Depends on the context? Is it likely they will enter exponent numbers? What happens when I would just enter 'e'
  • 20
    Here's a silly question. Why the fuck does it matter if users know that? If they don't, they just use digits. I did QA, it's about picking battles for the sake of time. Imo, this is super dumb.
  • 3
    Unless the concern is a malicious overrun, but if they didn't specifically state that, I call bullshit.
  • 1
    Use that exponent to make a number?
  • 10
    When you expect an integer value, force it to be one and do not allow exponents. Also, do not trust solely on type="number". It's only a first layer provided by the browser, I reckon you have at least a server side validation, and maybe a javascript based one.

    LSS: If you don't expect exponents, don't allow them either, indefinitely.
  • 7
    Actually, e is "Euler's number" which is a mathematical constant and roughly equals 2,718281828459045

    https://en.m.wikipedia.org/wiki/...
  • 7
    @kolaente Yes, when you consider e to be that constant, but when e is used as a notation it stands for "exponent" so 5e4 would be 5*10^4 and 5e*4 would usually be considered 5*(Euler's number)*4
  • 0
    To be fair it might not be obvious to those who are unfamiliar with what an exponent is. I mean, I used to see "e" in a number on a calculator screen and assume it meant "error" because it couldn't fit the whole number on the screen. I could use a computer and phone, I was familiar with web development and programming, but I wasn't that great at maths. I know what an exponent is *now*, but it might be alien to a lot of people.

    Its annoying to have to parse a string manually to check for decimals and THEN convert it to an integer though. Do wish there was a way to just do "simple" numeric input.
  • 1
    Android actually does this for the "e"

    And it doesn't seem like its doing it for exponent 🤔🤔
  • 2
    IMHO,
    I think it depends on what specification says... If it is an input for person id, then there should not be any letters at all. To be short it should be specified, is it *numeric* or *number*.
    What UX teached me, is that every user is dumb af and you should remove any confusing elements to prevent bugs and missunderstandings.
  • 2
    Id be pissed if my calculator didnt support e, although, imo it should be E not e, e should refer to eulers number
  • 0
    I understand... But you gotta cater for literally everyone, mathematically inclined or those who simply can't type and might have meant to your '3', not 'e'.

    Sucks, I know...
Add Comment