Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Mar 25, 2015 at 05:31 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.