Trim upto 2 decimal  points + js

Hi,
I want to trim a decimal number upto 2 decimal points.ie i
want to show only 2 digits after the decimal point.How do i acheive
this in Javascript. I do not want to use the Round function as it
causes the value to change by 0.01.
this is the code i've been using:-
document.getElementsByName("totalincvat_value_nett")[0].value
= parseFloat(totalincvat_value_nett).toFixed(2);
Is there any way to show upto 2 decimal points and cut off
the rest?
thnx

Hi,
Have a try with this custom function (I found this in another
forum)..
function roundNumber(num, dec)
var result =
Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}

Similar Messages

  • Upto 4 decimal point for unit of measure

    hi,
    We have requirement to maintain upto 4 decimal point in PO and sales order quantity for unit of measure M3. Example PO quanity 0.3902 m3, sales order quantity 2.3212 m3,   SAP allow upto 3 decimal point, how to handle this 4 decimal point for unit of measure and any impact to do so ?
    best rgds,

    Dear Eric,
    To change decimal places of Materials follow this:
    IMG - SAP NetWeaver - General Settings - Check Units of Measurement
    select Units of Measurement & select required Unit of Measure & set decimal places.
    Hope this helps...
    Give points if useful...
    Thanks,
    Jignesh Mehta

  • Condition type value to have upto 7 decimal points

    Dear All,
    We are calculating yield. The client wants us to take the value upto the 7 decimal points. Can somebody help me how we can achieve this. If this is a development how can we have this.
    Regards
    Chakradhar

    Hello Paturi,
    First you have to maintain the number of decimal places for the required currency.
    This can be done in spro--> general settings --> currencies --> set decimal places for currencies.
    Then the condition value comes automatically in the specified number of decimals.
    Hope this info helps you.
    regards,
    Bhanu.

  • How can see upto 2 decimal points

    how can i get the result upto 2 decimal points in a variable which is of
    double type, when i do
    system.out.print(variable name);

    Use DecimalFormat.
    DecimalFormat td=new DecimalFormat("0.00");

  • Change decimal points in SD Condition type from 2 to 3, for EU

    Hello,
    We have a slight problem with the amounts. We are using resource related billing in the project and to track some expenses, there are some condition types created. Since the currency is maintained as EU, the decimal places are maintained as 2 decimals in OY04 and we dont want to change that.
    We face an issue, when SAP Converts condition value from 3 to 2 decimals
    For example, when in Contract we have an Condition Value of 100.025, this is converted to 100.03 and tax is applied on this amount.
    When we create an invoice and subsequently a Credit Memo request, that will contain more than one item, and the sum of all items will have to sum up to 100.03, but this is never the case, as with the application of tax rate, the value comes to something like 100.02 or 100.04..
    With 3 decimal points, this amount adds upto correct value.
    So our ideal solution will be the have the Condition Values as 3 decimals and the Net value in 2 decimals.
    Is there something  that can be done for this?
    Hoping for a quick response.
    Regards
    Maddy

    SAP stores the 3 decimal value in XKOMV-kbetr and Xkomv-kwert is calculated based on this 3 decimal values...
    I had a similar scenario with currency conversion and rounding issue in sales Order and Invoice processing, in VOFM routines... so I used a Floating point  value and converted to character value and then used that 3 decimal value for calculation.

  • 2 Decimal points in inventory module

    Dear Expert,
    In SAP 2005, inventory module allowed for 6 decimal points somehow in SAP 2007, it does not allow for 6 decimal points only 2 decimal points are allowed.  When I try to zerolise my Inventory quantity, they still remain some quantity in the in stock field.
    Please advice.
    Regards,
    Saw Hua, Ng

    Hi,
    Refer this thread for what the decimal settings determines
    Difference between Decimal places for  Quatities and Units
    Even if the quantity is set to 6 decimal,the item master shows only 2 decimal places.
    Where as in the documents you can use upto 6 decimal places and same is stored in the OITM table.
    And also you can only increase the decimal places and once if it increased it cannot be decreased in 2007 version,refer this note:1147799 on the same.
    Hope this clarifies your issue !

  • Decimal Points for Unit of Measurement

    Hi all
    For doing service entry in the QTY field can we put the value upto six decimal for any unit.
    in customisation for Unit of measurement can we configure this thing putting decimal places - six or is there any other setting is required
    Please help
    Thanks in advance
    Rajesh

    Hi,
    Yes in customisation for Unit of measurement you can customize it,
    but it will be valid whenver you use this UOM in the system.
    There is one thing also you can do
    The Quantity fields decimal points in service entry is by default 3 digits ,
    so to use 1,123456  quantity for lets say price 10 $
    you can multiply both sides with 1000
    i mean
    use 1123,456 for 10000 $
    just an idea
    Regards
    Hope it helps

  • How to increase Decimal Points for the BOM Component Quantity

    Hi All,
    While creating BOM:
    Can anyone help me to know how i can increase the Decimal points for the BOM components quantity.
    I can able to give only upto 3 decimal points, but the requirement is more than that.
    I have increased the Decimal point value to 5 in transaction Code CUNI. but still it is allowing me to enter only upto three decimal places.
    Thanks and Regards
    Khadeer

    Khadeer,
    You would be better off changing the base quantity of the parent part.  Instead of "1 EA  parent contains .00003MG of  component" you could say "100 EA parents contain .003MG of component".
    Alternately, you could use different units of measure for your parent or component parts, which would be more suitable for the 3 place decimal limitation.
    I agree with Anil in that if you elect to change the decimals from standard, you could end up with huge changes that will propagate through every module in the ERP.  In my view, there is no need of this kind of headache.
    Best Regards,
    DB49

  • Lost decimal point after export to text file

    Dear All,
    I have problem which to beset me long long time. I haven't dug the cause yet. Actually, I have a program which will generate a text file in background everyday. The text file included po data which is create last day, such as po no, item, unit price etc. But sometimes, not every times, one of item data's unit price will lost the decimal point in the text file, for example, the po unit price is 18.80 stored in database. but the outcome is 1880 in the text file. Do you have encountered such kind of problem? Thanks!

    Hi
    sorry cant get you..
    need some more explanation
    can you send me the code
    Regards
    V.Balaji

  • Dynamic displaying of decimal points for currency field in ALV

    Hi,
            In ALV output there is a currency field and displaying data of different countries. It should display decimal point according to the country's currency. But at a time it can display data of different countries.

    Hi Dilip,
    I think your question is about currencies with different number of digits after decimal point. If you have the currency field in the ALV row, you have to give it's name as currency reference for the value field in the field catalog.
    After creating the field catalog, call a form and do something like this (change fielnames accordingly).
    <pre>
    *&      Form  alv_fieldcat_enhance
          Individual Enrichment of field catalog
    FORM alv_fieldcat_enhance
      CHANGING pt_alv_fieldcat TYPE slis_t_fieldcat_alv.
      FIELD-SYMBOLS:
        <alv_fieldcat> TYPE slis_fieldcat_alv.
      LOOP AT pt_alv_fieldcat ASSIGNING <alv_fieldcat>.
        IF <alv_fieldcat>-fieldname(5) = 'KBETR' OR
           <alv_fieldcat>-fieldname(5) = 'SKBTR' OR
           <alv_fieldcat>-fieldname(5) = 'DMBTR'.
    Company code currency
          <alv_fieldcat>-cfieldname = 'BWAER'.
    Document Currency for conditions, net value and taxes
        ELSEIF  <alv_fieldcat>-fieldname(5) = 'KWERT' OR
                <alv_fieldcat>-fieldname    = 'NETWR' OR
                <alv_fieldcat>-fieldname    = 'NPAX_MWST_AMNT'.
    Document Currency
          <alv_fieldcat>-cfieldname = 'WAERK'.
        ENDIF." <alv_fieldcat>-fieldname(5) = 'KBETR' or
      ENDLOOP." at pt_alv_fieldcat assigning <fieldcat_alv>.
    ENDFORM.                    " alv_fieldcat_enhance
    </pre>
    Regards,
    Clemens

  • Decimal point  for Price value in  ALV Report

    HI,
    I have created ALV report,
    I have 2 price fields in ALV report
    For first field i have to display  in the below format.
    If the value of the field is 3601152 then I have to display it as 36011.52 
    For second field I have to display in the below format
    if the  value is 2494 then I have to display it as 2495.00
    else if the value is 3498.73,then I need not to do anything.
    that means If there is no decimal point, then I have to keep decimal point.
    Thanks&Regards
    RamaDevi

    HI,
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
      concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Regards
    Nicole

  • How to delete decimal point and adding leading zeros....

    Hi,
    I have one requirement in the report   i.e.
            <b>Present Value    :</b>  44567.98
            <b>Expected Value  :</b> 0000004456798
    In the present Value how will I remove that decimal point and how to add those six ing zeros. I tried with CONVERSION_EXIT....but it is not giving. Help me...
    Thanks in advance.
    Regards,
    Kumar.

    Hi,
    Use SPLIT and COMCATENATE fnctions.
    Eg:  split l_v at '.' into l_v1 l_v2
            concatenate l_v1 l_v2 into l_v.
    For adding leading zeros
    Use FM CONVERSION_EXIT_ALPHA_INPUT.
    Eg:
    data: tknum type vttk-tknum value '99156'.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
         exporting
              input  = tknum
         importing
              output = tknum.
    Sri
    Message was edited by:
            Sri Tayi

  • Purchase price to have 4 digits after decimal point

    Hi Friends,
    Would you please help me out with this issue?
    The purchase price needs to have 4 digits after the decimal point, because the product/component would be packed and sold in other unit, which may give huge value difference.
    The price can be set for the product/component per 100, but is there any setting in SAP Reference IMG?
    Thanks for your help.
    Regards,
    JT

    Hi,
    In material Master (MM01) which unit you maintain for that material. Go to MM02 and keep Base Unit of Measure as storing unit as earlier and maintain Sales unit (unit of measure in which the material is sold) or Order Unit (Specifies the unit of measure in which the material is ordered) in the Purchase Order according to your requirement and Enter the factor for converting the alternative unit to the base unit. In your case product/component would be packed in a Different unit.
    OR
    In your case product/component would be packed in a Different unit.
    Maintain the (BOM) Bill of Material for the finished product you are selling and its component.Create Finished Product as material type as FERT and Components as material type as HALB or ROH.
    Now try your transaction with Finished Product only and sale.
    Hope the above  will help.
    Regards,
    Biju K

  • Rounding off during APP (f110) of decimal point

    Hi
    Can any one help me? When I run the T.Code f110 for automatic payment programme is generate cheque propaly, here my client want to rounding off for the decimal point in cheque amount as if coin adjastment.

    Hello Arup,
    I guess OB90 is helpful to you so pls check the same.
    Thanks & Regards,
    Lakshmi S

  • Convert the money datatype to a 2 decimal point format.

    Whats the best way to convert the money datatype to a 2 decimal point format in ms sql 2005 for use in my applications.
    this?
    CAST(tr.depositReceivedAmount AS decimal(10 , 2))

    I respectfully disagree with the notion that you should change the SQL column from a 'money' data-type to something else.
    In most database servers, 'money' is a data type that is designed to provide very consistent behavior with regard to arithmetic accuracy.  In Microsoft Access, the representation is a scaled-integer.  In MS SQL Server, it is obviously similar.  Ditto Oracle and all the others.
    You want the money data-type in the database to have this accuracy, because "hell hath no fury like an accountant in search of one lousy penny."   The database column storage-formats are designed to satisfy accountants, and that is a Good Thing.
    Meanwhile, you also want to take care as to exactly how you deal with the values.  There are several points where rounding could take place.  You do not have at your disposal the strongest possible handling of floating data-types in ColdFusion.  You are also somewhat at the mercy of whatever interface software may lie between you and whatever SQL server you may use.  "It's okay to round values once, but not multiple times."
    I suggest rounding the value right before display, and stipulating that the user's input must be two decimal places.
    Then, you might have to do some things at the SQL server's end.  For instance, when you update a value in the table, you may need to use server-side logic to explicitly truncate the value to two decimal-points, so that an update of "$34.56" explicitly updates the column to "$34.5600."  (This sort of thing has to happen within the SQL server context.)  You know that the user's input has exactly two significant digits, but maybe (maybe not...!) the SQL server might not know this.  You want to ensure that the server's internally-stored value represents exactly two significant digits, when the value originates from a user-input.
    Don't err on the side of "your convenience" or "what looks good on-screen."  (If you do, get ready to get phone-calls from the accountants, always at inopportune hours of the night.)

Maybe you are looking for

  • Where can I get replacement screws for the bottom of my MacBook Pro?

    I have a late 2011 13 inch MacBook Pro. I recently upgraded it from the stock 500 gigabyte 5400 RPM hard drive to a 750 gigabyte 7200 RPM Seagate Momentus XT Solid State Hybrd drive. When I was putting the screws back in the bottom case  I lost one o

  • Chapter Headings Are Not Exporting to PDF as h1-h3 tags

    With two-column layouts, even though I assigned PDF export tags to the chapter heading Paragraph Styles, they are not being exported to PDF with h1-3 tags. I'm using InDesign CS6 and Acrobat Pro XI on a 64-bit Windows 7 system. To export, I'm using t

  • Checking when a database was last modified

    Hi everyone, I've got an sql database with a few tables in it which are tied to a web service I have running. Thing is, when I invoke my web service (through a browser window), which is fine, the web service updates the database every time, even if t

  • "Sort Artist" Problem

    When browsing artists (Ctrl+B) in iTunes, "Jay-Z" and "Jay-Z Ft. MJB" sort different, even thought they both have the same album artist. When selecting "Jay-Z Ft. MJB" only one song appears. So I tried entering Jay-Z as "Sort Artist" for all songs in

  • Migration of BUPAs and business agreements

    Hello, Its my first thread and my English is not so good but i hope you can understand my problem. We have to migrate BUPAs from an NON-SAP system to an SAP CRM 7.0. We use the LSMW for this with IDOC Basic type CRMXIF_PARTNER_SAVE01. This is okay an