Round off quantity variable eliminating decimal places

Hi,
  I have a variable of quan type with value = 1008.123
  I want to round it off with no decimal to be displayed.
  Please suggest.

Hi,
  Refer
https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=4565374
https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=4721312
https://forums.sdn.sap.com/click.jspa?searchID=11055268&messageID=2700419
Regards
KIran

Similar Messages

  • Round off Double to 2 decimal places??

    Hi all the pro out there..
    anybody can tell me how to go about rounding off eg 5.9542 to 2 decimal places in java? i went to search in API Double class, no method that allow me to do that..
    is there any other way?
    pls advise thank you

    If the former, you can do it manually by multiplying by an appropriate number, casting to int, and then dividing by the same number.Although this won't always work.
    Suppose you want 1.125 --> 1.1
    1.125 --> 11.25 --> 11 --> 1.1 plus some epsilon, since 1.1 can't be represented exactly in base-2.Yes, I know that (I assume you knew I knew that). So, maybe the OP needs to use both methods in combination (and maybe use some rounding method [such as in the Math class] other than cast).

  • Rounding off float to 2 decimal places and returning the float

    I tried doing bigdecimal but it doesnt work. :
    BigDecimal bd = new BigDecimal(5 * 0.0394);
              retval = bd.floatValue();
              System.out.printf(" th %f\n",retval);
    I see 0.197000. I know that there are 6 places since I didnt do %.2f. However its not the printf thats important . The float I want to return must be rounded off to two decimal places.
    Thanks in advance for the help,
    sb

    Use BigDecimal.round( MathContext mc ), where the MathContext object is set to a precision value of 3;
    BigDecimal roundedBigD = myOriginalBigD.round( new MathContext( 3 ) );� {�                                                                                                                                                                                                                                                                                                                                                                                                               

  • Round a number to 2 decimal places

    Hi,
    I have a computed value that returns 10 plus digits after the decimal place, exampe: 2.2482352941176.
    What is the easiest way to edit this value in TestStand to return a number that is rounded up to 2 decimal places (2.25)?
    Thanks & Regards,
    Don1.
    Solved!
    Go to Solution.

    One way to do this is to use the TestStand functions Str and Val.  The %.2f rounds the number to 2 decimal places.
    Val(Str(Locals.MyValue, "%.2f"))
    Peter

  • How to round off quantity in inventory

    Hi,
    How to avoid decimal places for PC(Piece) in the goods movement transactions..  I have given 0 decimal places in CUNI transaction. It is working properly for Production Order during Conrimation but it is not working in Inventory transactions like MIGO, MB1C,MB1A....
    for example When I enter Unint of entry In Alternate Unit say '10 KG'  System Automatically Caliculates quantity in base unit in decimal places say 115.012 PC based on the conversion factor defined in material master.
    My requiremet is the base unit quantity PC rounded off to nearest value in as 115 (PC).
    The same thing is working fine for production order.
    please suggest me how to do.
    Thanks,
    Shekar

    this all depends on your conversion rate enterd in material master.
    if 115.012 PC  equals 10 KG.
    what do you actually want the system to do,
    it would now that you would get 115.012
    you want it to be 115,
    this would then mean that you have to modify the entered quantity from 10 to 9something
    Is it that what oyu want?
    you certainly cannot have 115 PC and 10 KG if you dont change the conversion rate in your material master

  • Rounding off to 0.05 decimal

    Post Author: masto123
    CA Forum: General
    Hi there,
    I am tring to round off a field which is displayed in AUD currency as $23.43 to $23.45. I have tried the round function
    round(,0.05) but I get an error. Is there any other way.
    pls help.
    regards
    m

    Post Author: yangster
    CA Forum: General
    If its a numeric value either a simple field or a summed field you should simply be able to format the number field and apply custom formatting to change it to 2 decimal places.  If its a text field you can use totext(field, 2).but the problem with your formula is that the format is round(field, #places)# of places needs to be a whole number not a fractionround(field, 2)

  • Rounding up to a particular decimal place

    Hi,
    I'm bringing a field into my report that uses up to eight decimal places.  I'm tasked with rounding things up to the fifth decimal.  Rather than rounding when the number is five or higher, it should always round up if it is above one.
    So for example:
    2.03827893 rounds up to 2.03828000
    11.40032180 rounds up to 11.40033000
    Any ideas on the best approach for achieving this within a Crystal formula?
    Any help would be greatly appreciated.
    Thank you.

    Hi Bob,
    Right click on the field and select "Format Field"
    In "Number" tab, select "Custom Style" then click on "Customize"
    In the Roundig box you can select the Rounding type.
    --Praveen G

  • BED & AED Round up or down without decimal places

    Dear Gurus,
    My client wants BED & AED Round up to nearest value without Decimal places.
    I am using taxinn procedure and JMOP for BED and JAOP for AED As a condition.
    I tried to tick round up in condition , but it is not workig.
    Please help.

    Hi,
    In TAXINN   T code : OBQ3  against ur condition in alternative calculation type (Calty ) column put 17.
    At the same time OB90 against ur company code put 100.
    Then ur problm will be resolved.
    Biswajit

  • Rounding a number upto two decimal places.

    Hey !
    My question is regarding the rounding of a number in such a way that answer that we get after the rouning comes upto two decimal places,no matter how small or the large the number before rounding was.
    Somebody please help me.
    thanks

    hi,
    use BigDecimal class in java.math package.
    here is some code how to do it ..
    BigDecimal bd = new BigDecimal(your number here);
    bd.setScale(2,BigDecimal.ROUND_DOWN)
    System.out.println(bd);
    hope this helps ...
    bye
    ashok

  • Rounding a number to 2 decimal places

    Is there anyway using the Round function to get it to .2
    decimal places rather than the nearest whole figure...
    I have a table that contains product prices, some of these
    are already in a nice 2 decimal format (such as 7.99 or 12.49) but
    I also have some that are like this-43.990002 and this-8.9899998.
    What is the best way to round these to 2 decimal places?
    thanks

    Do some experimentation. If you are using numberformat you
    might not need to use round.

  • Wm rounding off quantity

    Hi all,
    I have a storage type defined with large/small quantity as the picking strategy. I have maintained the rounding qty check in configuration and the rounding value in the material master. But when I create a TO, it doesn't round up to the rounding value. Am I missing any setting? I would really appreciate any suggestions.
    thanks

    Hi,
    Even if your material master is not extended to that storage type the settings of the storage type will be valid.
    Please check the "Stock reomval control" tab of the storage type definition, maybe "Full stk rmvl reqmt act." indicator is marked (SPRO > LE > WM > Master Data > Define Storage Type).
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/f846eb4afa11d182b90000e829fbfe/frameset.htm
    Regards,
    Csaba
    Edited by: Csaba Szommer on Dec 12, 2008 10:15 PM

  • Rounding up doubles to 2 decimal places

    I'm currently rounding up a double in my program using Math.round(double)
    However I want to strip any trailing zeros from the output, so:
    1.235 would round to 1.24
    but 1.00 would round to 1
    How would I go about doing this?

    Also I'm making my own function to round the doubles,
    and they are returning doubles so I cannot return a
    string.If they are returning doubles that the number of "trailing zeros" is irrelevant, as that is formating. Really you should keep the precision until you want to display it, then use the formatter above.
    What are you doing?
    I'm going to take a shot in the dark; has this got something to do with money?

  • Invoice Amount Rounding Off

    Good Day.
    Is it possible to have my selling price have 2 decimal places, but the Invoice amount will be rounded of to hundreds, only for a specific currency?
    Example:
    Price: 123.45 Yen per 1 pc
    Invoice Amount: 123.00 Yen  <-- rounded off, does not require decimal place
    Let me know.
    Best regards,

    hi
    not a problem.
    you need to maintain prices for your product with 2 decimals in VK11 so that this brings 2 decimal pricing in sale order.
    for rounding off in invoicing activate 'round off' condtion type to the nearest yen either up or down.
    hope this is useful to u.
    suresh

  • Rounding off to a variable value to 4 decimal values in sap script ouput

    Hi All,
    I have a value getting displayed in sap script output as 235.6789 i want to Round off this variable value to 4 decimal values!
    What is the formatting option need to be used & how!
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    1.In layout just call that variable, where you need like:
    &variable(.4)&.
    Just see these:
    &symbol(Z)&  Omit Leading Zeros 
    &symbol(S)&  Omit Leading Sign 
    &symbol(<)&  Display Leading Sign to the Left 
    &symbol(>)&  Display Leading Sign to the Right 
    &symbol(C)&  Compress Spaces 
    &symbol(.N)&  Display upto N decimal places 
    &symbol(T)&  Omit thousands separator 
    &symbol(R)&  Right justified 
    &symbol(I)&  Suppress output of the initial value
    Regards,
    If helpful reward with points(Don't forget).

  • Rounding off a float to two decimal places

    I want to make a function where I shall pass a float and and integer.
    The float shall have to be rounded off to a value in the integer.
    Can anyone please suggest how to round off a float.
    E.g.: if the float is 12.56890 and I want to round it off to 2 decimal places, then it should be 12.57.
    Regards
    Hawker

    I didn't mention any datatypes like float, double.True, but that is what the question is about, so you weren't answering the question. For a change.
    As I mentioned, that was just a mathematical steps to round of the floating point value. (Not in any programming languages point of view).False. You didn't mention that at all.
    This is the code for that in java.So here you are mentioning datatypes and floats for the same piece of mathematics that you have already been told, with reasons, doesn't work in floating point.
    which seems to be working fine
    Seems to. What evidence do you have that the float actually got rounded? As opposed to got displayed as rounded? Which is not what the OP asked for.
    And of course all that code seems to do is round 0.01 to two decimal places, which again is not what the OP asked for.
    For any remaining fans of this 'technique', please explain the behaviour of the following code:
         public static void     main(String[] args)
              int     count = 0, errors = 0;
              for (double x = 0.0; x < 1; x += 0.0001)
                   count++;
                   double     d = x;
                   int     scale = 2;
                   double     factor = Math.pow(10, scale);
                   d = Math.round(d*factor)/factor;
                   if ((d % 0.01) != 0.0) // if 'd' really has been rounded this should be zero
                        System.out.println(d % 0.01);
                        errors++;
              System.out.println(count+" trials "+errors+" errors");
         }

Maybe you are looking for