Question

If a customer were "silly" (being polite here) enough to try and add, as an example, 4.6 items to their basket, what would you expect to see? or how would you deal with it. Obviously, we only deal with digital quantities (our hacksaw broke last week).

There seems to be a lot of inconsistence across the web.

  • Amazon Rounds down (4.6->4, 1.3->1)
  • FireBox Rounds (4.6->5, 1.3->1)
  • Ebuyer ignores the input (no error)
  • Expansys removes the item from your basket
  • I'm assuming some site will show an error

Which is the best solution

Was it helpful?

Solution

  1. Add JavaScript verification that would remove non-numeric input while the user is typing in

  2. Implement backward solution for the situation when JavaScript is off, either display an error message or round the value but then display a message saying "your input has been adjusted"

ADDED: Also be aware that the character that separates the fractional part from the integer one differs from country to country. In US I believe it is '.', in Europe it is usually ','. If your applications is targeted at customers in different countries with varying number representation, it would make sense to implement the support for both characters in your application logic. Otherwise some users will get format error messages without knowing why - non-techie people are often unaware of this format issue.

OTHER TIPS

How about validating the user input and accepting only numeric characters?

One solution would be to bring the incorrect input to the user's attention so they can correct it. Rounding can be too much of an assumption depending on the context.

Displaying an error message next to the amount something like this: "I'm sorry, we cannot supply you with 4.6 items. Please enter a whole number." ...or something along those lines.

Another solution would be to avoid displaying error messages by restricting the input field to only allow valid input. ie If you don't want 4.6 items...only allow the user to be able to type 0-9. If the user can't enter incorrect input then there is never any reason to display an error message.

Assuming you're talking about a web app here, you can limit the characters allowed in the input box.

Alternatively, IMO you could use spinner (+/-) controls to change the quantity.

I believe tesco.com does this.

The best solution according to me would be

  1. Customer enters: 4.6
  2. Value changes to 5 after submitting (or if 4.4, round it to 4)
  3. Notice is displayed telling the user that only integers are valid and that the system has roundedy "your" input (4.6) to 5

One solution would be to inform the user that their selection is invalid when they tab off the edit field that's allowed them to enter the fraction.

A lesser option would be to round (down, unless you're greedy to sell 1 extra item), or to reject the input completely.

The best solution is to prevent fractions in the first place by giving them a slider or spin control to select only whole numbers.

At the end it's always safer add server side check.

So if the input it's not an integer value:

  1. I will redirect the user to the same form.
  2. I will set the field with the floor value (4).
  3. I will put on top of the field a message like"This field must be an integer value. May be did you want 4 pieces of this product?"

In my opinion if your product is an shopping system then it makes sense that primary goal is to sell some items. Usually customers want to perform as less actions as possible, so the system should predict what customer could possibly want when typing incorrect inputs.

  • Amazon Rounds down (4.6->4, 1.3->1) - the best for me, because everything after the decimal point can be destined to some other input;
  • FireBox Rounds (4.6->5, 1.3->1) - as for me I don't like when someone want to sell me more than I want to buy, so better 'floor' than 'round';
  • Ebuyer ignores the input (no error) - then you'll sell nothing and user needs to enter some values once again;
  • Expansys removes the item from your basket - terrible, now I need to search for the item in the shop once again;
  • I'm assuming some site will show an error. - not bad but required user to retype value;

I would implemented as Amazon plus informing user that input was not fully clear and asking him to recheck the value. So if the system guessed right then user need to change nothing but if he mistyped he'll see it immediately.

Also you could log all this kind of incidents and then perform an analysis, what user typed for the first time and what was the actual count he bought. Just for curiosity...

Well, you definitely should never round up. You should not ever bill for more materials than the customer requested, no matter how inane the request.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top