Closed Bug 108689 Opened 24 years ago Closed 5 years ago

XP way to show number in current locale (with correct decimal and thousands separators) needed

Categories

(Core :: Internationalization, defect)

defect
Not set
major

Tracking

()

RESOLVED INACTIVE

People

(Reporter: bzbarsky, Assigned: nhottanscp)

References

Details

(Keywords: helpwanted, intl)

There is a number of places in our UI that should really display numbers with thousands separators (typically file sizes). We should use the current locale when doing this. A library function to do this is needed so the various callsites don't all have to roll their own.
Blocks: 108658
Blocks: 74716
number format ->nhotta
Assignee: yokoyama → nhotta
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Target Milestone: mozilla1.0 → mozilla1.2
first, please be specific where do you see such issue. that will help us plan for a solution.
screen shot please.
Frank, please look at the particular bugs blocked by this one.
Blocks: 58610
Target Milestone: mozilla1.2alpha → ---
We need something similar to nsIDateTimeFormat for numbers. The way numerica formating is handled is platform-dependent so that we'd end up writing platform-specific instances of nsINumberFormat. Implementations in Java and ICU should be good starting points.
Keywords: intl
This must be solved before Firefox and Thunderbird 1.0. It is a very bad idea to ship 1.0 with improper size notations in various File Info and Properties dialogues. I want to notice that many European countries use commas (not periods) as a decimal separator. See bug bug 165200 for some relevant discussion.
Severity: normal → major
Flags: blocking-aviary1.0RC1?
Keywords: helpwanted
Summary: XP way to show number in current locale (with thousands separators) needed → XP way to show number in current locale (with correct decimal and thousands separators) needed
Note that most dialogs are using JS to show the number and hence are NOT affected by this bug -- they can use toLocaleString() in JS. Also note that this is effectively assigned to "nobody" at the moment.
I think we need to have some special way to format sizes. Right now it is very often that strings "KB" are hard-coded, which is wrong. Not every language uses Latin alphabet, and we must provide an easy way for localisers to localise on how they want to call their units. A good idea will be to provide a switch of what units must be used. Apart from obvious "byte", "kibibyte", "mebibyte" etc, we might have such switches as "Auto" and "AutoAndBytes". With an Auto switch, use the behaviour suggested by Nail in bug 108658 comment 6, i.e. 0--2047 in bytes, 2048 to 20971511 in KiB, (2^21) to (2^31-1) in MiB, etc. With an AutoAndBytes switch, show the same size as in Auto, and in addition show the original size in bytes, for example, "2KiB (2048 bytes)". This switch should be used in Page Info and Properties windows, or anywhere else where we need to show the size of only one element. For those who don't know what KiB is, visit <http://physics.nist.gov/cuu/Units/binary.html>.
Alias: numbers
Blocks: numbers
Alias: numbers
Flags: blocking-aviary1.0RC1? → blocking-aviary1.0RC1-
No activity since 2004. Assign to "nobody"?
QA Contact: teruko → i18n

Intl.NumberFormat in JS + ICU access in C++/Rust solved it.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.