Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected space in zh-tw LongDecimalFormatter thousands #90

Open
lionel-rowe opened this issue Dec 19, 2022 · 2 comments
Open

Unexpected space in zh-tw LongDecimalFormatter thousands #90

lionel-rowe opened this issue Dec 19, 2022 · 2 comments

Comments

@lionel-rowe
Copy link
Contributor

lionel-rowe commented Dec 19, 2022

Describe the bug

LongDecimalFormatter with locale zh-tw for numbers 1000..9000 gives an unexpected space:

zh-cn: 1千, 2千, 3千, 4千, 5千, 6千, 7千, 8千, 9千
zh-tw: 1 千, 2 千, 3 千, 4 千, 5 千, 6 千, 7 千, 8 千, 9 千

Multiples of <100 and >10,000 are unaffected.

To Reproduce

console.log(
	['zh-cn', 'zh-tw'].map((locale) => `${locale}: ${Array.from({ length: 9 }, (_, i) => i + 1).map(n => {
		const TwitterCldr = require('twitter_cldr').load(locale)

		return new TwitterCldr.LongDecimalFormatter().format(n * 1000)
	}).join(', ')}`).join('\n')
)

Expected behavior

Results for zh-tw's 1000..9000 should look identical to those for zh-cn for that same range.

Environment

twitter_cldr 2.2.0, Node v16.13.0

@camertron
Copy link
Collaborator

camertron commented Dec 23, 2022

Very curious. It looks like the data itself is wrong. Must be a bug with the Ruby code that generates the data.

@camertron
Copy link
Collaborator

Turns out the data in twitter-cldr-rb is wrong in v3.1.2, the version -js uses. The problem has since been fixed, but later versions of twitter-cldr-rb don't work because a number of internal classes etc have changed in the intervening years. We will need to upgrade the -rb dependency, which is going to be a project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants