Amount formatting¶
We should never display -0 value. It should be always replaced with 0.
Numbers with decimal part should be displayed with two decimal numbers even if it is not necessary, e.g. 34.1 -> 34.10.
However, trailing zeros (.00) are always removed in all locales.
Circles¶
Formatting of circles is different, because we have very limited space. We usually try to fit into 4 characters for the amount. Amounts in circles are less precise and are there just to get a quick idea about who should pay next. Ellipsizing in circles would look bad.
This chart shows how we should display amounts in circles:
| Raw value | Displayed amount (CS locale) | Displayed amount (US locale) |
|---|---|---|
| 0.004 | $0 | $0 |
| 0.006 | 0,01 Kč | $0.01 |
| 3 | 3 Kč | $3 |
| 3.1 | 3,10 Kč | $3.10 |
| 3.10007 | 3.10 Kč | $3.10 |
| 31 | 31 Kč | $31 |
| 31.3007 | 31,30 Kč | $31.30 |
| 314.3 | 314,30 Kč | $314.30 |
| 3442.45 | 3 442 Kč | $3,442 |
| 34 421 | 34k Kč | $34k |
| 340 421 | 340k Kč | $340k |
| 1 210 000 | 1,2M Kč | $1.2M |
| 12 100 000 | 12M Kč | $12M |
| 120 452 000 | 120M Kč | $120M |
| 210 000 000 | 1,2B Kč | $1.2B |
| 12 100 000 000 | 12B Kč | $12B |
| 121 100 000 000 | 121B Kč | $121B |
All other amounts¶
Numbers between -1 and 1 are rounded to 10 decimal places.
Other numbers are formatted with 2 decimal places.
It's OK to ellipsize long numbers, usually there is enough space in the UI.