on 06-21-2016 12:44 PM
Hello All,
We have created Fiori with the field Sales_Value, Please find the screenshot below
Here we have value as for example 69473214.80 and we want to convert it into million format , please let us know how to convert the value into millions/ billion etc and if we have to write any code please be specific where to write in Web IDE.
Hi,
Please refer link: https://sapui5.hana.ondemand.com/sdk/explored.html#/sample/sap.ui.core.sample.TypeCurrency/preview
Please check if Class sap.ui.model.type.Currency suits your requirement.
In WebIDe, You can bind as below in your view:
<Text text="{parts:[{path : 'BilledValue'}, {path : 'BilledCurrency'}], type:'sap.ui.model.type.Currency'}" maxLines="0" id="__text26"/>
Output:
You can also use/extend class sap.ui.core.format.NumberFormat.getCurrencyInstance and write your own formatter method.
Hope this help.
Thanks,
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just add the formatOptions.
style parameter as short and decimal to control the precision (no. of decimal points) you need.
Ex:
<text="{parts:[{path : 'BilledValue'}, {path : 'BilledCurrency'}], type:'sap.ui.model.type.Currency', formatOptions: {style : 'short', decimals : 10}}" maxLines="0" id="__text26"/>
Output:
Does this help? If not you need to write your own formatter method.
Please look at the formatting options available for currency formatting:
The standard uses CLDR number pattern: Number Patterns - CLDR - Unicode Common Locale Data Repository
Thanks,
Vinod
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.