cancel
Showing results for 
Search instead for 
Did you mean: 

Custom date format and Amount format based on locale for sap.m controls

preethi_ande
Participant
0 Kudos

Hi,


Date:


I was able to display the date format based on locale(ie en = Mar 25 2015, en_GB = 25 mar 2015) but i want to set the date format as 25/03/2015 without using dipslayFormat in sap.m.DatePicker


<DatePicker id="oDateTo" value=" " valueFormat="MM/dd/yyyy"

  displayFormat="dd/MM/yyyy" />\

Amount:

Need to format amount based on currency(INR). Getting always ###,###,###

Regards,

Preethi

     

Accepted Solutions (0)

Answers (1)

Answers (1)

kedarT
Active Contributor
0 Kudos

Hi Preethi,

For Date format why not have both value format and display format the same?

Use below for Currency formating

jQuery.sap.require("sap.ui.core.format.NumberFormat");

oType = new sap.ui.model.type.Float({

    maxFractionDigits: 3,

    groupingEnabled: true,

    groupingSeparator: ",",

    decimalSeparator: "." });

And while binding do this - path: "{Amt}", type:oType

Hope this helps.

preethi_ande
Participant
0 Kudos

Hi,

Date Format: want to reuse the same application for multiple customers so we didnt want to use the valueFormat andf displayFormat.

Currency: we want to format the amount based on currency using the api FormatAmountStandardWithCurrency but it is formatting the amount properly for EUR and USD and but not for INR. Is ther any other api which will format properly