Skip to Content

How is currency formatted in the sap.m.ObjectNumber API

We use the sap.m.ObjectNumber to display the number formatted based on the currency key as shown below. I have issues with formatting of the USD vs EUR. The decimal and thousand separator shows the same as shown below. For EUR, I except ',' as decimal seperator and '.' as thousand separator. For USD, I except the opposite. My understanding is that it is formatted based on the regional settings of your computer. However, when I tried to change it , it does not reflect in the UI. Anybody ,please explain how is this thing working.

<ObjectNumber class="sapUiSmallMarginBottom" binding="{/ProductCollection/0}"
number="{ parts:[{path:'Price'},{path:'CurrencyCode'}], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false} }"
unit="{CurrencyCode}" numberUnit="{CurrencyCode}"/>
currency.png (10.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 27, 2017 at 07:41 PM

    Hello Nirmal,

    There are mutiple ways to handle this . One of the ways is

    <ObjectNumber binding="{/}" number="{ parts:[{path:'Price'},{path:'CurrencyCode'}], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false,decimalSeparator : ',', groupingSeparator : '.'} }" unit="{CurrencyCode}" numberUnit="{CurrencyCode}" />

    There are other ways as mentioned here

    Thanks and Regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for the reply.

      What "parts : []" is doing?

      If I put only 1 value or same property like actual amount ( see image below ), my value (price) is not formatted as currency.

      Can anyone explain or send documentation URL where path : [] is explained?

      screenshot-18.jpg (34.2 kB)