Skip to Content
0

Fiori currecny formate based on SU01 decimal notation

Jun 19, 2017 at 03:11 PM

111

avatar image

Hi All,

I have some currency fields on XML/JS views currently I am applying below code

{parts: [
                               {path: 'CreditValue'},
                               {path: 'Currency'}  
                                       ],
                                     type: 'sap.ui.model.type.Currency',
                                     formatOptions: {
        showMeasure: false 
            }
        }

And in SU01 decimal notation is set as "1.234.567,89"

But on UI I can see value is with ',' separated

for ex : 300000000 is displaying like 300,000,000.00 but expected is "300.000.000,00"

Any clues are really helpful

Thanks

Rajesh

10 |10000 characters needed characters left characters exceeded

Is the decimal notation for the user set as 1.234.567,89 in both the backend and frontend systems?

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Pavan Bhamidipati Jun 20, 2017 at 07:15 AM
0

Hi,

One way I found is to get the user notation format from the User Master and then accordingly in the controller try to set the format options of the control. If it is always the INR format then following are the possibilities:

<mvc:View controllerName="mysap.ui5.demo.walk.controller.App" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" xmlns:u="sap.ui.unified">
<App>
<pages>
<Page title="{i18n>title}">
<content>
<!--<u:Currency value="2300.12" currency="INR" useSymbol="false" />-->
<Text text="{ path: '/number', type: 'sap.ui.model.type.Currency', 
formatOptions: { groupingSeparator: '.'
, decimalSeparator: ','  } }"/>
<!--<Text text="Hello World"/>-->
</content>
</Page>
</pages>
</App>
</mvc:View>

The other way is use the SAP.UI.UNIFIED reference. and mention the currency type.

Probably you can end up creating your own formatter function.

Thanks, Pavan

Share
10 |10000 characters needed characters left characters exceeded
rajeshkumar rajeshkumar Jun 20, 2017 at 01:36 PM
0

Hi Pavan,

Thanks for response, yes up to some extant your solutions worked for XML views.For my requirement I need the solution for JS as well.

I am reading user notation from custom service and setting groupingSeparator and decimalSeparator.

JS currency convertion

var formatter = sap.ui.core.format.NumberFormat.getCurrencyInstance({showMeasure: false}, sap.ui.getCore().getConfiguration().getLocale());formatter.format(.Netwr);

Thanks

Rajesh

Share
10 |10000 characters needed characters left characters exceeded