Is there any logical reason behind digit alignment on a calculator? If yes, can we apply this for visual interfaces of numbers on the web?
Screen digits are right aligned to maintain positional consistency between what a number represents (in base 10 that would be units, tens, hundreds, etc.).
E.g. If I were to have 764 and then multiply it by 24, the answer would be 18336. By aligning to the right I've consistently seen the same unit representation in the same position, and when I've had new units (the 1 and 8 in 18336), they have appeared in a new position.
It also allows there to be a consistent alignment between character groupings (typically every 1000, but in some cases 100s and 10,000s)
Can we apply this for visual interface of numbers on web?
Yes, we can, and indeed we should. Left aligned numbers when listed below each other are a disaster and should be avoided. I can't think of a single case where this isn't true. If you want to just use a number in a sentence, then go ahead and left align, as there is no positional consistency to maintain in the first place.
As a side note, the underlying reason why they are right aligned instead of left aligned is that the modern number system was adopted from Arabic, which is a right to left language and hence right aligned. It's worth mentioning that the Arabs adopted it from the Indians (who were mostly Hindu), which is why it's often called an Arabic-Hindu number system. The European number systems pretty much sucked.
Digits are right aligned for similar reasons as you would right align them in a spreadsheet or a table.
i.e. when you see multiple numbers (and they all have a fixed set of decimal places), then it's easier to compare the numbers with each other because the digits corresponding to each place value are in the same physical position, thus making it easier to compare input and result - we are simply used to expecting a place-value digit in a consistent location.
Yes a simple calculator only has one number displayed, but nevertheless you do multiple calculations one after the other and the results are less likely to be mis-read if there is a common reliable placement of the decimal point. When left aligned, and reading from left to right, there is a need to first scan the number to determine it's size and the location of the decimal point before making sense of the number itself. Locating the decimal point to the right makes this sense-making process consistently easier.
This may extend back to the use of mechanical adding machines, used for bookkeeping or accumulating prices of objects, where there would always be two decimal places, (no more, no less) and these were fixed on the right hand side of the machine. The German example below shows numbers in a European (non British) format.
All the unused digits are zeroed. On a calculator they are simply absent.
With the invention of mechanical calculators, like Pascal's calculator of 1642, everything was mechanical, so the position of place values was physically determined by wheels or dials, much like the adding machine above.
I suppose the fixed position of digits goes back to the abacus, before written number systems came into effect. Beads moved on wooden columns that were fixed in position. Unused columns (i.e. when showing smaller numbers) to the left and the used columns (if any) coming from the right.
Can we apply this for visual interface of numbers on web?
Of course and this is commonly the default case in user interface elements that display values that are specified as currency for example, or tables that display numbers in a columnar format.
Fields that can take either characters or digits have an alignment property so you can adjust accordingly. However - note that there is a big difference between entering or displaying a number because it's a standalone quantity, or a label or a telephone number, for example, and entering a number for the purpose of doing a mathematical operation or displaying accounting values. There is no need to right align all numbers - you do have to consider context as to whether it's useful for the user to see the numbers aligned left, right or centered!
As an example, on the right hand side of this page are a list of related questions. You wouldn't right-align the number of votes displayed against them 'just because it's a number', but if you were numbering sections in a document, you might.
I don't have any data about this question, neverthless here my thought: Readability is much better for right aligned numbers. Why? Consistency. The Decimal points always stays at the same location, decimal separators too. So it is much easier for a user to identify how big a number is.
PS: We are probably very biased by now, so my point with readability could be absolutley wrong. Maybe it was just a technical constraint when they first built calculators.
When using right aligned numbers you must note that decimal separators are aligned only if there are equal amount digits after decimal separator:
12 345,90 132 987,9376
Aligning such numbers left would probably be even worse, so in cases where number of digits after decimal separator are not equal numbers should probably be aligned by decimal separator.
12 345,90 132 987,9376
In general, columns of numbers which are being examined as numbers should be decimal-point aligned (or right-aligned if the only decimal point is "implied"). Quantities which involve more than one radix point (e.g. currency amount in Britain prior to decimalization) should align each radix point, and right-align the columns between them; e.g. an itemized bill might read:
1. 0. 3 .10. 6 23.13.11 -------- 25. 4. 8
Times written in hours/minutes/seconds would follow a similar rule, but for the fact that all parts other than the most significant are written with a fixed number of digits and include leading zeroes.
When calculators are set to display a fixed number of digits to the right of the decimal point (a common feature on adding machines, though not on cheap handhelds), they obey this principle. Calculators in floating-decimal mode (the only mode available on many cheap handhelds) generally align decimal numbers as they do because it's consistent with their behavior when using whole numbers (which keep the decimal point at the far right) and because it makes the electronics simplest.
When using right alignment, nothing has to keep track of how many digits are entered. If each digit uses five bits (four to hold the value and one for the decimal point), entry of the decimal is allowed whenever none has been entered yet, and entry of anything else is allowed when all bits for the leftmost place are zero (the digit is zero and there's no decimal point). Further, the display electronics can unconditionally blank leading zeroes that don't have their decimal flag set. Allowing numbers to be entered left-to-right would require keeping track of how many digits were entered, and adding hardware to the display circuitry to distinguish "one point two" from "one point two zero" [the latter should show an extra trailing zero].
Because people expect to be able to pick up any calculator and simply use it without "surprises", it's generally better for an ordinary-looking calculator to behave in fashion consistent with other such calculators than for it to do anything unusual. Unless a calculator will have some features that would really benefit from having the display fill left-to-right, it will probably be better to have it scroll right-to-left in the same was as 99.9% of other calculators on the planet.
In our system, numbers in our common calculators are shown in powers of ten. Let’s take a number ‘8634’.
8634 = 8x1000+ 6 x100 + 3 x10 + 4 x1
So starting from right to left, we have 0 power 10 then 1 power 10 then 2 powers 10 and so on.
To keep it simple, this tradition makes readability easy from right to left.
I would dare even a different reason: Because we made the historical error of making the least-significant digit position at the right, when everything we write is from left-to-right.
I will explain with an example. Now consider this addition, which parcels have their least-significant digit at the left:
"three, twenty, eight-hundred, six-thousand"
+ 175 3286 ———— 4937
It gives as result
"four, ninety, three-hundred, seven-thousand"
Wouldn't it fit better and feel more natural to have the calculation like this on our left-to-right writing system?