How to keep 2 decimal places for double value

Hi,
I need rounding function, which should round a double number till 2 digits, if there is no decimal part it should append 2 zero's in decimal places.
eg. 100 --- > 100.00
200.234 --> 200.23.
I tried with Number class. but it is returning string, from that string if I try to convert to double value, it is rounding off one digit.
Can any one help on this problem.
Thanks,
Suman.ch

I am using xmlBeans using that I need to write this
rounded value into a xml file, for that I need only
double value with 2 decimal places.You can probably write the value as a String instead of a double somehow, so you can use the DecimalFormat class.
You could try their mailing-lists for users/developers:
http://xmlbeans.apache.org/community/index.html

Similar Messages

  • How to change the decimal places in the value axis of a chart in WAD?

    Hello,
    The key figure in my chart has 2 decimal places and I want the value axis to show the same. How to do that?
    Thanks in advance, Nathalie

    Hi,
    change the Format property of the ValueAxis-Line to 0.00
    Then the axis displays its values including two digits after the decimal.
    Regards, Kai

  • How to assign Two Decimal Places for numeric Columns(urgent)

    Hi all,
    I have lot of Numeric fields under Advance table Section.
    for those fields data is coming single decimal point (42.5).
    but client want to see the data upto two decimal points like 42.50
    how to achieve this functionality.
    Please give me some idea on this functionality.
    it is very urgent for me.thanks in advance
    thanks
    vinu

    Use OADataBoundVariables and set the US currency format for the data. It would come accordingly. You can look for the exact code in some other threads.
    Another option is to set the decimal format in the getter of the VO. It would show accordingly on the page.

  • Decimal places in double value

    I am sending a number to my program - 99999999.99 and parsing it as double.
    double d = Double.parseDouble("99999999.99");
    When I print this out, it prints - 9.999999999E7
    The problem is, my database won't accept it unless I provide this value exactly as '99999999.99'.
    I truncated the decimals using DecimalFormat, but the database needs to receive the value as a number only, not as a String that is returned by format function.
    How do I make my program pass the same value from the String, but as a number?

    I am trying to pass it to a stored procedure, so setting it as -
    cstmt.setDouble(1, Double.parseDouble("99999999.99"))
    My problem is that the database field which corresponds to this is of type numeric(8,2).
    When the number is parsed as double and is sent to the database it looks like this - 99999999.989999995, so the database rejects it.
    Why is the number '99999999.99' being changed to '99999999.989999995' on converting it to double? How can I make it a double number, yet restrict the number of digits after decimal to 2?

  • Table TQSS1, field NKSTAT (Decimal Places for Statistical Values, e.g. Ind)

    Hi QM Gurus,
    I would like to know as how this field NKSTAT is populated in table TQSS1 - Table.
    which customizing step is this maintained?
    I checked in QM settings at Plant level - customizing step too..
    Thanks in advance !!

    Hi,
          I think issue  is not of config. pl check your table seting.
    se16 -
    >TQSS1----->add desired details like plant etc  and execute -> settings (Header) - format list---> choose fields -
    >click on your field NKSTAT and other desired  feilds and copy . definately your field is gate populate in your table.
    Cheers,

  • How we can increase decimal places in Sales Order for Qty

    Hi,
    In Sales Order qty field now its 3 decimal places for MON unit of measure but we want 4. how we can increase decimal places.
    Thanks in advance
    Thanks & Regards,
    PM

    To elaborate better.
    Again, use Tcode CUNI - Unit of measurement : Initial Screen.
    At initial screen, choose TIME from the list (where by default AAAADL- no dimensions is there).
    And click on UNIT OF MEASUREMENT button.
    In that you will find MON - Month.
    There go for details by selecting MON or select MON and press F5 from Key board.
    For MON unit maintain following parameter as per your requirement:
    -Number of decimal places for number display
    Use - This parameter determines the number of decimal places with which this measurement unit is displayed.
    -Base ten exponent for floating-point display
    Use - This exponent determines how the values for this measurement unit are formatted as floating point numbers.
    Examples - If the exponent is 3, the floating point numbers have the format xxx.xxxxE3.
    And deselect commercial meas. unit in application parameters section.
    I would suggest instead of changing standard settings of MON, you create ZMON in TIME dimension.
    Thanks & Regards
    JP

  • Without to change the setting.how to set the decimal place to 7 for an UDF.

    Without to change the setting, how to set the decimal place to 7 for an UDF?

    Hi
    Once you create a UDF it will automatically be binded to the data source of data type that you gave at the time of creating UDF.
    So i think you can not set the decimal places without changing the setting in display parameters.
    i am not sure whether it will work or not one thing you can try is that create it as a alphanumeric data type and convert your decimal value to sting and then assign it to UDF,While retrieving for any manipulation you convert it as decimal.
    Hope it helps you
    Regards
    Vishnu

  • Decimal places for JPY currency in change documents

    Hi Gurus,
    For opportunities in SAP GUI the change documents for JPY show incorrect numbers.
    The number is divided by 100 (two decimal places added).
    Checked the CDPOS table and found the values already divided (two decimal places added).
    SPRO->General Settings->Currencies->Set decimal places for currencies is set for 0 decimals for JPY.
    Is there any way I can get correct values in the change documents?
    Please advice. Any hint is useful.
    Thx,
    Martin Kuma

    Hi Naren,
    Thank you for the tip, however the TCURX table is changed via customizing and should be changed only during the system initialization.
    What I would like to do, is to assure that the system displays the values in change documents correctly. It should apply the currency conversion for the data displayed the same way it does for all the tables.
    Do you have any idea, how should I do this?
    Regards,
    Martin Kuma

  • How to set  two decimal places in currency inr

    hi,
    i want to set two decimal places for my co.code currencu inr.  In t-code oy04 there is no 2 decimal places. Please tell me how set decimal places so that amount in account balances should be in two decimal places.
    thanks
    amol

    Hello,
    If your currency code entry isn't in OY04 customizing step, your currency code has 2 decimal place automaticly. If you want to define a special decimal place without "2", you must define it in OY04.
    Regards,
    Burak

  • More DECIMAL places for MM price-Not Global

    I have read the <u>many</u> postings on decimals. However, I have not seen the exact scenario I'm inquiring about.
    I want to increase the decimal places from 2 to 4 for the cost of materials we purchase (i.e. supplier price), but I do NOT want to set this as a global aspect for the company when dealing with numbers/currency.
    It's not just a simple matter of setting a different unit of measure, because let's say we order a reel of capacitors - the reel may come in qty of 1,000 or 2,500 (only one example). So, we really need to set price by (ea). The problem is that many of our parts price at .0014 (example) and in SAP that shows a cost or price [depending on where you're looking] of zero. Plus, the Purchasing agent sends a PO with incorrect price information.
    <b>It would be very helpful if anyone could tell me how to increase the number of decimal places for specific fields as opposed to globally.</b>
    Thanks you!!

    The right tool to do that is the pice unit. This is in the system for ecatly that purpose, to provide more precision in prices. It has nothing to do with unitz of measure that is used for logistical purposes.
    If you have a price 0f 0.0014 each you can set a price unit of 1000 and will have a price of 1.40 for 1000. You still can have only 500 or even 1 on stock. the calculation done if you receive your 2500 will be 2500 * 1,40 / 1000 which is of course the same as 2500 * 0,0014
    best regards,    Udo

  • HOW to remove the decimal points for particaular field

    hi friends,
    Iam printing the quntity in decimal mode like 2.000.
      but i want to print this as only 2.
      How can i remove the the decimal in smart form..
    Iam  printing  amount as 1234.00000.
    But i have to print two zeros after decimal point..how can i remove zeros .
    appricioate for u r answers..
    regards,
    sampath kumar

    You may use the option
    field(.0) for printing the quantity
    field(.2) for printing the amount..
    Go through SAP help given below..
    <b>Number of Decimal Places
    A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
    Syntax
    &symbol(.N)&
    The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
    &EKPO-MENGE& -> 1,234.560
    &EKPO-MENGE(.1) -> 1,234.6
    &EKPO-MENGE&(.4) -> 1,234.5600
    &EKPO-MENGE&(.0) -> 1,235</b>

  • Decimal Places for Currencies

    Impact on the processes of change at MM decimals for Currencies.
    We want to use foreign currency to 6 decimals anand two decimal places for the currency of society

    Dear José Luis Flores ,
    Please always make sure your business process not reach the limitation of overflow during
    the conversion as the Price it is always with 11 characters with 2 Decimal place (9,2) in standard.
    All together 13 characters.
    If this limitation was reached, you will received the dump message. This is normal and you had to
    make sure it suits your business requirement in the beginning to avoid any changes later . You
    had to plan it before do this type of customizing in very beginning.
    Thanks
    Ian

  • Changing the Decimal places for Percentage in cost distribution in SC

    Hi Gurus,
    Is it possible to change the number decimal places for the Percentage field in cost Assignment tab in Shopping cart in cost distribution option?
    The user wants 3 decimal places, currently we can enter only 2 decimal places.
    I have gone thro' couple of blogs which are talking about changing the price decimal and not the percentage field decimal. (in IMG setting: General settings > Currencies > Set Decimal places)
    So, if anyone come acorss this issue, please let me know.
    Thanks and Regards,
    Nowsath

    Decimal Places Factor of the Receiver Weighting Factors
    Specifies the number of valid decimal places with which the given weighting factors are valuated.
    Example
    You enter 123456 as the weighting factor. Depending on the factor, this number is interpreted as:
    Factor Decimal places Weighting factor
    1 0 123456
    10 1 12345.6
    100 2 1234.56
    1000 3 123.456
    10000 4 12.3456
    100000 5 1.23456
    1000000 6 0.123456
    Please check with your FICO consulant .what settings you have in backend system.
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/bdbdc4575911d189240000e8323d3a/frameset.htm
    Muthu

  • Changing decimal places for currencies

    Hi everyone,
    I'm a complete begginer to SAP BI and I need to change a value in SPRO > General Settings > Currencies > Set Decimal Places for Currencies, but the option that I want doesn't exist.
    I need to add a new entry with the value: currency - EUR6 and decimals 6, but there is no 6 available. Can anyone tell me where can I add this or what is the table where this information is???
    Thanks in advance!
    Rogério Brá

    ok I think it works - just try and play
    This is what I did (sort of same scenario - if you get my drift)
    Currency Key MGF - translation ratio 1000:1
    Exchange rate is : 11:02750 to the Euro
    Invoice entered for 1,000,000.00
    Currency calculated as 90.68 eur
    (ie 1,000,000/(11.02750 * 1000))
    You can play aroudn with direct/indirect to ge the factors right
    But it works (I thought it did - I am qualified FICO honest!!)
    This wont get you around displaying 6 decimals - BUT it will help with currency conversion

  • Question about decimal places for currencies

    hi ,experts ,
       here is the problem , when i use mb5s, i found the net price has been enlarged 1000 times . I  also found the data of the table EKPO has been enlarged 1000 times. So ,i check the decimal places for currencies , i found there are five decimal places , the standard system is two decimal places . 
       Does this mean that we cann't  change the decimal places in SAP?  If we can change , what should we do for configuration ? 
    Jarod

    When running OY04, you are receivingin the following message:
    Before you continue, please read the following        
    text carefully.                                       
    If you do not heed this note, you can cause
    irreparable damage to the system with this            
    transacton.                                           
    In the R/3 System tables currency fields are          
    stored as decimal figures with a variable number      
    of decimal places. The decimal point is not           
    stored in the field in the database. Instead,         
    each currency field refers to a currency key          
    field. In this transaction you assign the number      
    of decimal places to this currency key uniquely.      
    Example: If you have set currency USD to have         
    two decimal places and you post an amount of 100      
    USD, an amount of 10000 USD is stored in the          
    Do you want to change the decimal places despite      
    all recommendations?

Maybe you are looking for

  • Downloading of ALV output to excel by asking the password

    Hi all,            I need to down load the ALV output into the excel sheet. But the thing is that before going to download the output into excel sheet, the system has to prompt for password.once it happens then the user will enter the password and it

  • Problem in writing Hindi Font in properties file at run time.!

    hi, We are using Language translator for our project. We are able to convert the language in hindi and chinese language. Im also creating properties file respective to each page in hindi,english and chinese language. At run time while CREATING proper

  • Jsp generating 0 bytes

    I have a jsp that writes some static content for now. Sometimes when i           access it generates a 0 byte response. In the access log           i see a success status ie. 200 with 0 bytes. Do anyone know why its           happening.           -sh

  • Occasional Hangs/Freezes on new Macbook Pro 15 2.5 GHz

    I got this incredible MBP for my birthday a few months back and recently it hangs randomly when logging off, restarting or shutting down. I have to hold down the power button and power cycle it. I have the latest version of Leopard 10.5.3 and all upd

  • Many forms issues in one spool

    Hello, Can we have many forms issues(smartforms) in one spool? I need to send one print stream / PCL format not multiple spools. Best Regards,