Closed aboccassiniavvale closed 3 months ago
Reading also this part of the documentation https://sapui5.hana.ondemand.com/sdk/#/topic/91f2f2866f4d1014b6dd926db0e91070.html, it would appear that the 'short' style is also not working as it should show '123M USD'.
To format a number in compact format, set the option style to either short or long. These styles control which version of scale name is used. For example, 1000000 is formatted as 1M with short and 1 Million with long.
Hello @aboccassiniavvale ,
I couldn't reproduce the issue. I am using Google Chrome in "en" locale. In my case the currency is formatted to "123,457K USD". Can you test again? Double check if the code you have written is reflected to the sample.
Best regards, Petar
Hello @dimovpetar ,
thanks for your help. I tried with the "en" locale and it works fine. Is it possible to have the same formatter with "K" unit in other locale?
I also noticed that the 'long' style is not respected anyway. I would have expected "123 Mio USD", right?
Best regards, Alessandro
Hello @aboccassiniavvale ,
What locale were you using at the first example? It might be that 123.456.789,12
is the expected "short" value.
Best regards, Petar
Hello @dimovpetar , i was in "it" locale.
Thanks, Alessandro
Hello @aboccassiniavvale ,
I have created internal query with number DINC0124876. Our currency experts will give their statement whether:
Best regards, Petar
Hello @aboccassiniavvale ,
The behavior you describe corresponds exactly to the expected behavior and is therefore not an error. The CLDR specifies whether and how a currency deals with certain format options. As you can see at https://github.com/unicode-org/cldr-json/blob/44.0.0/cldr-json/cldr-numbers-full/main/it/numbers.json, it is not intended in the Italian language to use the "K" in the "currencyFormat-short". The behavior for "long" is also as expected because "long" does not exist in the currency and the default is therefore used.
Best regards, Stefan
OpenUI5 version: 1.122.0
Browser/version (+device/version): Google Chrome 123.0.6312.122
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency/sample/sap.ui.core.sample.TypeCurrency
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result? I would have expected the amount to be formatted taking into account the shortRefNumber parameter even with the value 1000. I would only like to format the value in thousands and not in millions.
What happens instead? The formatter does not seem to work for the miles unit
Any other information? (attach screenshot if possible)
![image](https://github.com/SAP/openui5/assets/144323043/1184d748-e5c4-41ff-9093-3c16823a45fd)