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

Support concise number skeleton #2512

Closed
SandroMaglione opened this issue Jan 18, 2021 · 3 comments
Closed

Support concise number skeleton #2512

SandroMaglione opened this issue Jan 18, 2021 · 3 comments

Comments

@SandroMaglione
Copy link

Hi,

I am trying to display different measure units based on the current locale.
Following the example of currency and the specifications I did this:

{
  "price": "The price is: {price, number, ::currency/EUR}",
  "unit": "Unit {value, number, ::unit/meter}"
}

Unfortunately, it does not seem to work:
Screenshot 2021-01-18 183053
currency works, while unit does not display m (for meters) as I expect.

Am I doing something wrong? How can I achieve this also for other units (weight)?

@longlho
Copy link
Member

longlho commented Jan 18, 2021

try the long skeleton version: measure-unit/length-meter

@longlho longlho changed the title How to define unit measure in json messages Support concise number skeleton Jan 18, 2021
@SandroMaglione
Copy link
Author

Thanks @longlho, it works with the long skeleton.

I can't seem to find the skeleton for how to achieve the same result for weight measures (kg, lbs, etc.), do you know if a skeleton for weight measures exists and if it is supported?

@longlho
Copy link
Member

longlho commented Jan 19, 2021

The list of sanctioned units are here: https://402.ecma-international.org/7.0/index.html#table-sanctioned-simple-unit-identifiers

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

No branches or pull requests

2 participants