on ‎2017 Oct 10 11:08 AM
Hi Team,
How to do format of OrderQty in SAP UI5 Table with localization.
Ex: Order Qty: 1,000.01
en-US: 1,000.01
in German format it should dispaly as 1.000,01
How to do this at table column defination.
regards,
Srisailam G
Request clarification before answering.
Hi Srisailam,
you can use number format, pass the number and locale to the formatter,
you can refer sdk here
for example :
View.xml
<Table id="productsTable" items="{/ProductCollection}">
<columns>
<Column id="netPrice" hAlign="End"><Text text="Price"/></Column>
</columns>
<items>
<ColumnListItem>
<cells>
<ObjectNumber number="{parts: [ {path: 'Price'}, {path: 'Locale'} ], formatter:'.numberFormatter'}"/>
</cells>
</ColumnListItem>
</items>
</Table>
formatter
numberFormatter: function(val, locale) {
var oLocale = new sap.ui.core.Locale(locale);
var oFormatOptions = {
minFractionDigits: 2,
maxFractionDigits: 2
};
var oFloatFormat = NumberFormat.getInstance(oFormatOptions, oLocale);
return oFloatFormat.format(val);
}
Regards,
Vedaradhya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.