I have a form where I want a user to put a price.

When loaded, the price is displayed as 12.3456. Is it considered bad practice to reformat the user's input to match this format?

Input          | Formatted
12.3456        | 12.3456
12             | 12.0000
12.34          | 12.3400
12.34567       | 12.3457

2 Answers 2


It's unnecessary to display all decimals of a number unless there is a specific need to show the way you mentioned.

Here are three formats of abbreviating large numbers:

enter image description here

For the tiny column do use a tooltop on mouseover to show the whole number:

enter image description here


Reformatting the input is fine, however you'll want to align your formatting to match the users expectations. (Or better yet, let them save a user preference)

Eg in The US/Canada I would expect only 2 decimals for cents to be displayed (unless I'm in some specialized software that needs to show more accuracy)

That said, formatting to this precision would be annoying if all the values you work with never use it (Eg house prices that range from $50k to $50M) as it would just be visual noise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.