Currency format for locale de_CH

Hello,
One of my customers has told me that
"Here in Switzerland, currency amounts with 0 cents are written with a long dash, 4.-- instead of 4.00."
It seems that Java doesn't know it. If I'm using the de_CH locale, I will always get 4.00. How can I achieve this with Java besides replacing .00 with .--? Could this be a bug?
Here's a small test. The result is
SFr. 1'234.00
but the right result should be
SFr. 1'234.--
private static void test() {
     Locale locale = new Locale("de", "CH");
     NumberFormat format = DecimalFormat.getCurrencyInstance(locale);
     Currency currency = Currency.getInstance("CHF");
     format.setCurrency(currency);
     BigDecimal amount = new BigDecimal("1234.0");
     String value = format.format(amount.doubleValue());
     System.out.println(value);
}Thank you for your time,
Nicu

Thank you all for taking the time to answer.
I did a quick check on a large Swiss company page (the Swiss Post) and here's what they say:
"Withdraw cash at the post office counter free of charge up to CHF 4'000.- per withdrawal."
They use the same convention. A dash instead of zero. Here's the link: http://www.postfinance.ch/pf/content/en/seg/priv/pay/card/pcd.na_priv.html.
Here's another link that explains the same thing: http://elearning-uk.myswitzerland.com/index.php?SN=pv5qudaru57ilcsdvbftcm7cs1&ac=user_seminar_view&cid=60&pid=255.
Unfortunately, I don't know how I could specify such a format in Java. The only solution I came up with was to replace zeros with a dash if the locale is de_CH. But that's not quite elegant.

Similar Messages

  • Change currency format for my Locale

    The default currency format for my locale (es-AR) formats negative currencies like this:
    ($1.232,23)
    I'd like to change it to
    $-1.232,23
    Any ideas on where to start? Where is that format option stored? In windows the currency format is the latter, and I can change it, but Java uses its own... (right?)
    Thanks for your help.

    Thanks, I found the javadoc that sais that.
    If you need to customize the format object, do something like this:
    NumberFormat f = NumberFormat.getInstance(loc);
    if (f instanceof DecimalFormat) {
         ((DecimalFormat) f).setDecimalSeparatorAlwaysShown(true);
    I think it would be nice to be able to customize a Locale information... to avoid the above code and have a more general solution.
    Thanks anyway, if you think of anything else, let me know.
    Bye.

  • How do you change the date/currency format for every user in OSX 10.6?

    I imaged a bunch of mac labs at work only to realize the base image has the date/currency set for United States rather then United Kingdom. The regional settings are correct.
    I tried changing it on the local admin account but it does not affect a new user that logs onto an AD account.
    Workgroup manager does not seem to offer anything either unless I am missing it.
    Any ideas?

    Hi Uncle,
    Page 116 of the Pages'09 User Guide: Control Click the date, Edit Date and Time.
    Date and time can also be in a table. Format the table cell.
    The User Guide is well worth a read. Download it from the Help menu in Pages.
    Regards,
    Ian.

  • How to get a currency format for a character field

    for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
    how do i do this?
    if i do SELECT to_char(:c_1,'$999,999')) from dual;
    it gives me ora: 01722: invalid number error
    c_1 is a user parameter of data type character

    Try using TO_NUMBER first, as in something like:
    SQL> VARIABLE c_1 VARCHAR2(6)
    SQL> EXECUTE :c_1 := '633948';
    PL/SQL procedure successfully completed.
    SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
    TO_CHAR(T
    $633,948Hope this helps.

  • Currency Formating for a Input Textfield (ASP)

    I am using Dreamweaver CS3 and VBScript coding.  I have a regular text field where the user will be entering in a dollar amount and ultimately I want a user to enter in 5000 and when they hit tab to the next field I want that number to appear as 5,000.00.  Searched the forums for a while and there where different variations but none answered this questions.
    Thanks

    I don't use that language, but it looks as if FormatNumber() is what you're looking for.
    http://www.w3schools.com/vbScript/func_formatnumber.asp
    Mark A. Boyd
    Keep-On-Learnin' :-)
    If you are reading this via email, be aware that it may not be an accurate representation of my message. Login to read the actual message and/or to reply.

  • Currency format in LAC

    Hi,
    We are working with LAC, and we have an issue.
    When we create an auction in SRM the currency format for the start price and the others is 1,234,567.89 (this is correct for us), but when we execute the applet (LAC) the format change 1.234.567,89
    The user in SRM has the correct format 1,234,567.89 then, Why in the applet the format is different????
    How can we change the format????
    We are working with EP then, we execute the transaction  bbp_auction since a Portal iview. Our single sign On between LAC and Portal was configurated, then we guess, we need to change the currency or number format in the Portal User, Is that correct?????
    What user do we need to change (currency format)????   SRM user????  Portal user???? LAC user????
    Thanks

    Hi Claudia,
    Check the following note :
    Note 666849 - Running LAC in non-US locales
    This may help you.
    Thanks,
    Pradeep.

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • Tables for local currency - PO

    Dear Sir,
    For my PO history report, Im taking the datas of Mat docs (mseg,mkpf), invoice (rseg,rkpf) and excise on j_1iexcdtl.
    Other than import type of PO ,Im getting the values in INR amount as given/available. So for Import PO's, problem Im facing in ,getting the amount of invoice and material documents are in International currency format as given other than INR , which i want to total the amounts of all PO's for my client in INR values.
    Pls post me, is there any other tables which have the local currency amount(converted) details of the Particular PO - Import,corressponds to mat doc number and invoice number.
    I'll appreciate ur feedback.
    Thanks & regards
    sankar.

    Hi,
    Use the F.M CONVERT_TO_LOCAL_CURRENCY
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING
    CLIENT = SY-MANDT
    date = sy-datum
    foreign_amount = XXXX "enter the amount which is to be converted
    foreign_currency = YYY "enter the currency of the amount to be converted
    local_currency = ZZZ "enter the to currenct
    TYPE_OF_RATE = 'M' "enter the type of the rate
    READ_TCURR = 'X' "check this is you want to take the data from table tcurr
    IMPORTING
    EXCHANGE_RATE =
    LOCAL_AMOUNT = amt "this is your result
    EXCEPTIONS
    NO_RATE_FOUND = 1
    OVERFLOW = 2
    NO_FACTORS_FOUND = 3
    NO_SPREAD_FOUND = 4
    DERIVED_2_TIMES = 5
    OTHERS = 6
    Regards,
    Satish

  • Information required for all currency formats settings.

    I need information in Web Dynpro Java for currency format.
    currently I have following fields in application:-
    1.Wrbtr Amount in document currency
    2.Waers Currency Key
    In local dictionary I could see Amount type as simple type in external representation I could see #,###.00## format.
    This format has a problem with Yen currency that if ECC shows 1000.00 then Portal shows only 100.00.
    Please let me know how dictionary works about pair of keys an values of above fields.
    Please let me know solution of this problem.
    Higher points will be rewarded for immediate solution and appericated also.

    Hallo Laxmikant,
    to correctly format BigDecimal price values depending on a given currency YOU MUST apply structure binding:
    - define a dictionary structure with a currency field AND an amount field and relate the amount field to the currency field.
    - bind a context node to this structure so that the context attributes are created from the sturcture fields.
    In this way the Java Dictionary Runtime will correctly format the decimal places for the amount depending on the given currency key (see ISO 4217). For the Jordanian Dollar JOD three decimal places are rendered, for the Japan Yen (JPY) zero.
    Look at this [Table Tutorial|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%207.0/web%20dynpro%20sample%20applications%20and%20tutorials.htm#46] which applies the sctructure binding and currency-formatting technique.
    With your formatting pattern approach on simple type level you cannot adapt the formatting pattern for different currencies.
    In NW CE 7.1 you can use the new CCTS-datatype Amount.
    Regards, Bertram

  • Rouding Difference error in MIRO for Local currency

    Hi Gurus,
    While posting invoice in MIRO, PO currency is EUR, system is showing correct balance in document currency but in local currency system is showing difference of .01 cents and not allowing to post.
    How to recitify this issue?
    Please revert asap.
    Regards

    Hi,
    Try setting Tolerance limit in OMR6
    If you want to round off the Values in the amount field at the time of invoice posting in MIRO. There will be a small difference amount positive or negative in the Balance field. System does not automatically round off the values. It is manually rounding only.
    Maintain the Tolerance key DIF for the Company code . Maintain the Tolerance values says + or - .50 INR in OMR6. & select the Check limit boxes
    Regards
    KK

  • No local currency found for plant and sales org.

    Hi Guru's,
    I am face to a problem that i don't understand.
    I load the standard master data 0PLANT and i have the basic issues : No local currency found for plant and sales org.
    I already saw this error so i check the basics to solve it.
    I respect the comp_code, sales_org and than plant sequence.
    i checkek the routines, no problem.
    for some plants it works. i extract 8 plants 2 works the rest not. the reason is that there is no sales org affected in my PSA table for those plants.
    But (and this is the problem) when i check the SAP source table T001W i can see that plants are corectly affecte to sales organization
    So do you have any idea of my problem ?
    do you know the transaction on ECC to maintain division and sales org affectation
    Thannks
    Cyril

    Hi,
    Pls have a look at this similar post:
    [No Local Currency found in Plant |How can I view the code for a routine in an update rule;
    Hope it helps...
    Regards,
    Ashish

  • GL account needs to block for local currency & another cur. needs to post

    Hi,
    I need GL account that should block for posting in local currency, it should post other(forgien) currencies. how can i handle this scnerio.
    if there is any balance,is it possiable to maintain validation.could you please let me know,how i can resolve this problem.
    Thanks in advance
    Jaya

    Hi,
    Though a document is created in foreign currency, system will also update the amount in local currency based on the conversion rate given in the document or maintained in OB08 table.
    If your requirement is to allow only foreign currency transaction for a GL account, then write validation with the condition that - If GL account no is XXXXX, check document currency is not equal to local currency (BKPF-WAERS).
    Regards,
    Rengaraj

  • Output Format for Currency

    Hi There,
    I have set defaults as '1,000.00' for currency output in the own data but in the output of report it is showing like '1.000,00'.
    PS: there is no formating statement in the program as well.
    Any advice friends, how can I make it in required format.
    Regards,
    Shabbar

    HI ali ,
    yeah u can do thi sin scripts ..
    take a look at this ..
    Country-Dependent Formatting: SET COUNTRY The formatting for certain field types depends on the country settings. These field types include, for example, date fields and number fields that include either a decimal point or the ‘thousands’ separator character. The formatting options defined in the user master record are usually the ones used here. To choose a formatting option other than the one specified in the user master record, use the SET COUNTRY control command. The country-dependent formatting options are stored in the T005X table. Syntax: /: SET COUNTRY country_key You can enter the country key either as a literal value enclosed in quotes or as a symbol.
    /: SET COUNTRY 'CAN' /: SET COUNTRY &country_key& Use a blank country name to revert to the setting found in the user master record: /: SET COUNTRY ' ' This SAPscript command actually calls the corresponding ABAP command internally. This guarantees the effect of the SAPscript command to be identical with that of the ABAP command
    regards,
    VIjay
    Message was edited by:
            vijay k

  • CHECKING for currency format

    Hi,
           i am checking the currency format amount.the rule is Right justify amount decimal point and 2 decimal places. Not to use commas or the $ sign.
    for the above condition the code is:
    data:val type string.
    val = '123456789.00'.
      if val co '.0123456789'.
        shift val right deleting TRAILING space.
      else.
        if val cs ',' or val = '$'.
          replace ',' with space into val.
          replace '$' with space into val.
        endif.
      endif.
    but iam getting '$' and ','. mark in o/p.
    how can we check this condition.help me out from this issue.
    Thanks
    Message was edited by:
            skk

    Try this.
    [code]parameters : val(30)  type c.
    data : final(30) type c,
           cnt type i,
           v type c,
           n type i.
    cnt = strlen( val ).
    do cnt times.
    move val+n(1) to v.
    if v ca '.0123456789'.              "Bring in the values
    move v to final+n(1).
    *elseif v = ',' or v = '$'.             "<---no need of this
    *continue.                              "<----no need
    endif.
    n = n + 1.
    enddo.
    condense final no-gaps.
    write:/ final .[/code]
    regards,
    vijay

  • Additional local currency EUR for compyny codes with Currency EUR

    Hello,
    for reporting reasons we would like to add a "second" currency EUR for the comnpany codes that already have EUR as company code currency.
    Is that possible?
    Do you expect difficulties?
    Thanx & Regards
    Britta
    Edited by: Britta Heimann on Mar 2, 2011 9:14 AM

    Hi,
    I know companies having local currency XYZ and second local currency EUR and due to EUR-conversion they have now 1st and 2nd currency EUR.
    But apart from that, what is the idea of having such a scenario? Different currency ex. rate types or translation dates for all foreign currency postings?
    Anyway, from my point of view it is possible...
    Best regards, Christian

Maybe you are looking for

  • IPhoto won't open after a reinstall.....

    You'll have to excuse my lack of specific Mac details, as I'm relatively new on the system. I've got a Mac mini, had it for about 8 months, and the system froze up and would not restart. I talked to an associate in an Apple store, told me to reinstal

  • Where is the keyboard click sound located?

    Hi, I would like to change the sound the Mac plays when using keyboard click sounds. Any idea where the sound file is located? I figure I can just swap in a new one. Thanks, Allan

  • Macbook Pro power cables

    Hi I bought I macbook pro in the summer of 2009 and then in 2010 I dropped it on the floor and this summer got a replacement. I'm pretty sure the new MBP I have has some sort of different power going to it than my old MBP - I believe the new MBP func

  • Want to create analysis for this year week vs last year week

    All, My requirement is to create an analysis for the passed week number of this year vs same last year week no. So basically user will pass the week no. and report should display the passed week no. this year sales number plus same week no. last year

  • ICal crawling SO SLOOOOOOWWW! Please Help!

    It's actually on my sister-in-laws 1.6ghz G5 Powermac, but I have run out of ideas to try and help her.. Granted, she has about 17 very full calenders, but there is definitely something wrong.... iCal takes about 8 seconds to launch, moving from fiel