[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #5390(closed: fixed)

Opened 6 years ago

Last modified 3 years ago

Add compact currency forms

Reported by: mark Owned by: mark
Component: currency Data Locale:
Phase: dsub Review: emmons
Weeks: Data Xpath:
Xref:

Description

We need to be able to format currency forms in a compact manner also, such as:

$135B

In most cases, this can be done by using the Currency format in the compact number patterns that already exist. For example, for English we have "000B" for the compact pattern for the item above. So we can use the existing framework to format with the two patterns:

x = 135

curpat = "$#,###"

result = "$135"

compat = "000B" eg prefix = "", suffix = "B"

result = "$135B"

However, in some languages this may produce odd results.

x = 135

curpat = "#.###$"

result = "135$"

compat = "000B" eg prefix = "", suffix = "B"

result = "135$B"

It might be that "135B$" would be a better way to do that.

So, I suggest that we build samples using the combination approach, and see if it acceptable. If so, we can just document the usage. If not, we can look at adding alternate patterns for languages that need it (probably only those that we know need it, to prevent confusing others.)

Attachments

Change History

comment:1 Changed 6 years ago by emmons

  • Owner changed from anybody to mark
  • Priority changed from assess to major
  • type changed from unknown to enhancement
  • Status changed from new to assigned
  • Milestone changed from UNSCH to 23dsub

comment:2 Changed 6 years ago by emmons

  • Milestone changed from 23dsub to 23dres

comment:3 Changed 6 years ago by mark

  • Milestone changed from 23dres to 24dsub

comment:4 Changed 6 years ago by mark

After looking this over, I think we can wait until dsub2 (perhaps later) to see if the formats need additional structure.

comment:5 Changed 6 years ago by mark

  • Milestone changed from 24dsub to 24dsub2

comment:6 Changed 6 years ago by mark

  • Milestone changed from 24dsub2 to 24dvet

comment:7 Changed 6 years ago by mark

  • Milestone changed from 24dvet to 25dsub

comment:8 Changed 5 years ago by mark

  • Component changed from unknown to dtd

comment:9 Changed 5 years ago by emmons

  • Milestone changed from 25dsub to 25rc

Moving all 25dsub and 25design tickets to 25rc. If you plan to complete items in the 25M1 time frame, please move those tickets to 25M1.

comment:10 Changed 5 years ago by mark

  • Milestone changed from 25rc to 26dsub

comment:11 Changed 5 years ago by mark

  • Milestone changed from 26dsub to 27

comment:12 Changed 4 years ago by guy.lacoursiere@…

I did a bit of research for one of our products. Compact currency formatting is far from simple.

When the multiplier and the currency symbol are on opposite sides of the number, formatting currencies is similar to formatting numbers. That is “simple” enough.

However, when the multiplier and the currency symbol are on the same side, it becomes difficult:
1) to determine which one comes first
2) whether the different parts are separated by no-break spaces (such as U+202F — Narrow No-Break Space).

For example, from the following patterns:

x = 135
curpat = "#,### $"
compat = "000M" eg prefix = "", suffix = "M"

The following results are all possible, depending on cultural usage:

result = "135M$"
result = "135 M$"
result = "135M $"
result = "135 M $"
result = "135$M"
result = "135 $M"
result = "135$ M"
result = "135 $ M"

There are also variations depending on whether the multiplier is abbreviated or not. In English, for example, it would be common to see:

"$135M"
"$135 million"
"135M USD"

Also, even when the multiplier and the currency symbol are on opposite sides of the number, there may be particular cases where they are together. For example, in en-US format, we’d write:

"$135M"

But, in a header, we’d normally see

"Cost (in M$)"

not

"Cost (in $M)"

Guy Lacoursière
IBM - Business Analytics

comment:13 Changed 4 years ago by markus

  • Phase set to final

comment:14 Changed 4 years ago by mark

  • Phase changed from final to dsub
  • Milestone changed from 27 to 28

comment:15 Changed 4 years ago by mark

  • Priority changed from major to critical

Bumping the priority so that it gets finished before submission

comment:16 Changed 4 years ago by mark

  • Priority changed from critical to major

Constructed data is being added before submission. It is of the form:

			<currencyFormatLength type="short">
				<currencyFormat type="standard">
					<pattern type="1000" count="one" draft="provisional">¤0</pattern>
...

Except for root and English, it is provisional.

comment:17 Changed 4 years ago by mark

  • Status changed from assigned to reviewing
  • Review set to emmons

comment:18 follow-up: ↓ 21 Changed 4 years ago by emmons

  • Status changed from reviewing to accepted

I just added these to modern coverage, so they would show up in ST. Looks like the examples are screwed up, however, as the example for 4-digits count=one in English shows up as "$1295.00K", which is clearly not what you want.

comment:19 Changed 4 years ago by emmons

See http://st.unicode.org/smoketest/v#/en/Compact_Decimal_Formatting/ - we may also want to consider moving these to a separate page, since compact decimal was already one of the slowest pages to load, and this just adds another 50% to the burden.

comment:20 Changed 4 years ago by markus

  • type changed from enhancement to dtd
  • Component changed from dtd to unknown

comment:21 in reply to: ↑ 18 ; follow-up: ↓ 22 Changed 4 years ago by mark

Replying to emmons:

I just added these to modern coverage, so they would show up in ST. Looks like the examples are screwed up, however, as the example for 4-digits count=one in English shows up as "$1295.00K", which is clearly not what you want.

No, that isn't the desired format. I'll take a look at that.

comment:22 in reply to: ↑ 21 Changed 4 years ago by mark

Replying to mark:

Replying to emmons:

I just added these to modern coverage, so they would show up in ST. Looks like the examples are screwed up, however, as the example for 4-digits count=one in English shows up as "$1295.00K", which is clearly not what you want.

No, that isn't the desired format. I'll take a look at that.

Looks like you already made a separate page for all the Compact stuff.

comment:23 Changed 4 years ago by mark

  • Status changed from accepted to reviewing

I think I've fixed the decimals problem. Needed to factor out a common method for doing the "count" stuff.

comment:24 Changed 4 years ago by mark

The decimals still show up in a few situations, although it is better.

Where they show up is where we really should be suppressing the form, because it shouldn't occur. An example is

one: 00K

The 00 means that the leading digit will not be zero, so it can go from 10..99 (plus fractions). However, until we cut over to the better (now in ICU) method of getting the plural samples, we can't be sure of that.... There's a separate bug on this.

comment:25 Changed 4 years ago by emmons

  • Status changed from reviewing to closed
  • Resolution set to fixed

comment:26 Changed 3 years ago by pedberg

  • Component changed from unknown to currency
View

Add a comment

Modify Ticket

Action
as closed
Next status will be 'new'
Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.