ROUNDING a number

I have field that I (round(total,1)) round to 1 decimal place (102.2), but it doesn't round if it is a whole number (100.0). Does anyone know how I can round a whole number to one decimal place (with a .0).
Thanks in advance.
~Vannette
null

I understand how to do this in Reports... but I used the round function at the data level of the report (PL/SQL). Is there a way to do this at the data level?
Thanks.
~Vannette

Similar Messages

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • Need help with Rounding a number.

    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    I'm sure there's a simple fix that I'm just not understanding. I hope I explained my problem well enough, I'd appreciate any help I can get. These numbers are to calculate insulin dosage, so I need to be sure the math is correct.
    Thanks in advance for any help!

    yvieinca wrote:
    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    The explanation is that you don't understand what you are doing.
    When you ask numbers to display 0 decimal, you don't ask it to round the contents but to display the rounded value.
    A contents remains 3.6 but the display is 4
    an other contents may be 3.6 too displaying 4
    When you sum, you ask number to add the contents (3.6 + 3.6) which is 7.2 and you ask it to display the rounded value of this result. So you correctly see 7 not 8.
    If you want to get what you described, you MUST force Numbers to round.
    First,I don't understand how you may invent such a silly thing like =Sum(L8/C5)
    You are asking Numbers to sum the result of the division L8/C5 to nothing.
    The correct syntax would ask it to calculate the quotient, no less no more.
    =L8/C5
    but here we need to round so, in D18, enter
    =ROUND(L8/C5,0)
    in F18, enter
    =ROUND(E8/F5,0)
    In G18, =Sum(D18+F18) is silly too.
    You are asking nummber to sum (D18+F18) and nothing.
    The correct formula may be:
    =SUM(D18,F18)
    or
    =D18+F18
    Yvan KOENIG (from FRANCE samedi 13 juin 2009 18:05:33)

  • Rounding a number up

    Is there anyway you can create a calculation to only round a number up and not down?

    You can use Math.ceil() to round up a number in JavaScript.

  • Needed to round a number to nearest thousand

    Hi all,
    Can any one say is there any function to round a number to nearest thousand.
    example == 73882 it must be rounded to 74000.
    Thanks
    Ravi
    use small case when you are posting the questions
    Edited by: Vijay Babu Dudla on Dec 15, 2008 12:09 PM

    Hi
    try this:
    DATA: V_IN TYPE I VALUE 73882,
          V_OUT TYPE I.
    DATA: V_1  TYPE I.
    V_1 = V_IN DIV 1000 + 1.
    V_OUT = V_1 * 1000.
    WRITE V_OUT.
    or
    DATA: V_IN TYPE I VALUE 73882,
          V_OUT TYPE I.
    DATA: V_1  TYPE I,
          V_2  TYPE I.
    DATA: V_DELTA1 TYPE I,
          V_DELTA2 TYPE I.
    V_1 = V_IN DIV 1000.
    V_DELTA1 = ABS( V_1 * 1000 - V_IN ).
    V_2 = V_1 + 1.
    V_DELTA2 = V_2 * 1000 - V_IN.
    IF V_DELTA1 < V_DELTA2.
      V_OUT = V_1 * 1000.
    ELSE.
      V_OUT = V_2 * 1000.
    ENDIF.
    WRITE V_OUT.
    Max

  • 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  Trunc one number and Round another number in different row?

    Here is a sample where I take a percent of a number.
    <code>
    SELECT 40*.5 AONE, 'A' aname
    FROM DUAL
    UNION ALL
    SELECT 121*.5 AONE, 'B' aname
    FROM DUAL
    UNION ALL
    SELECT 121*.5 AONE, 'C' aname
    FROM DUAL
    UNION ALL
    SELECT 80*.5 AONE, 'D' aname
    FROM DUAL
    </code>
    this gives me
    20 A
    60.5 B
    60.5 C
    40 D
    I want to TRUNC one number and ROUND another number where the number has a
    "0.5" so I would have
    20 A
    61 B
    60 C
    40 D
    I will have more than 4 records, just trying to keep it simple.
    Suggestions?
    TIA
    Steve42
    Edited by: Steve42 on Dec 5, 2011 1:44 PM

    I missed you only want to truncate/round where value fractional part is .5:
    WITH SAMPLE_TABLE AS (
                          SELECT 40*.5 AONE, 'A' aname FROM DUAL UNION ALL
                          SELECT 121*.5 AONE, 'B' aname FROM DUAL UNION ALL
                          SELECT 121*.5 AONE, 'C' aname FROM DUAL UNION ALL
                          SELECT 80*.5 AONE, 'D' aname FROM DUAL
    SELECT  CASE MOD(ABS(AONE),1)
              WHEN .5 THEN
                        CASE MOD(ROW_NUMBER() OVER(ORDER BY CASE MOD(ABS(AONE),1) WHEN .5 THEN ANAME END NULLS LAST),2)
                          WHEN 1 THEN TRUNC(AONE)
                          WHEN 0 THEN ROUND(AONE)
                        END
              ELSE AONE
            END AONE,
            ANAME
      FROM  SAMPLE_TABLE
      ORDER BY ANAME,
               ROW_NUMBER() OVER(ORDER BY CASE MOD(ABS(AONE),1) WHEN .5 THEN ANAME END NULLS LAST)
          AONE A
            20 A
            60 B
            61 C
            40 D
    SQL> SY.
    Edited by: Solomon Yakobson on Dec 5, 2011 5:05 PM

  • Round the number to upper range

    Hi guys!!
    I need to round the number 5.552 to 5.60. how can I do this? even if the number is 5.51 then also it will be 5.6. How to do ?
    Thanks
    Kazi Mokarem

    Since Jens gets to introduce a fudge number, so can I :-)
    Depending on how you feel about 5.50
    SQL> SELECT ROUND(5.51 + .05, 1) round_up1,
      2         ROUND(5.50 + .05, 1) round_up0,
      3         ROUND(5.51 + .04, 1) still_round_up1,
      4         ROUND(5.50 + .04, 1) round_down0
      5  FROM dual
    ROUND_UP1  ROUND_UP0 STILL_ROUND_UP1 ROUND_DOWN0
           5.6        5.6             5.6         5.5TTFN
    John

  • Rounding Up number?

    Does anyone know how, or whether it's possible to get Pages to round numbers up instead of down for .5's?
    for example get 19.065 to round to 19.07 instead of 19.06?
    the only time i can get it to round up is for 1's ( 12.015 would round to 12.02 for example)

    Are you talking about using the ROUND(x,y) function? It does round up; i.e., ROUND(19.065,2) returns 19.07.
    From what I can tell, this is a display issue only. For example, if you reduce the number of decimal places in your number format, it APPEARS to "round" as you describe. But the value actually is retained. (To see this, multiply the cell value by 10 or 100 in another cell; the result will be that factor times the original cell entry, NOT the "rounded" value displayed.)
    However, if you apply the ROUND function, it works as you would expect -- traditional rounding.
    If you check more closely, I think you'll find that It does what you describe not just for 1, but for any odd integer preceding the 5. Even integers "round" down, odd integers "round" up.
    This is called "banker's rounding". It's used by -- yep, bankers -- and commonly in databases like Access. It tends to balance out the effects of rounding. It does seem odd that Pages isn't consistent between formatted and actual rounding, though.
    MacBook Pro   Mac OS X (10.4.9)  
    MacBook Pro   Mac OS X (10.4.9)  

  • Round decimal number to two places

    trying to round a decimal number to two places i.e. 1.98999 should round to 1.99.
    -tried using math.round but it only rounds to nearest integer
    -tried using decimalformat class but that converts to string, and cast wont allow me to convert from string back to double
    *is there a round method that allows you to specify decimal places?
    *or is there an easy method to cast a string back to a double?
    any advice is appreciated:)

    coynerm wrote:
    trying to round a decimal number to two places i.e. 1.98999 should round to 1.99.Agree.
    -tried using math.round but it only rounds to nearest integerI advise against rounding in most newbie situations. Usually it's the display of the variable you want to change.
    -tried using decimalformat class but that converts to string, and cast wont allow me to convert from string back to doubleOf course cast won't allow you to convert back. If you wanted to do that you'd use Double.parseDouble(stringVar); But we don't know why you are doing all this converting in the first place.
    *is there a round method that allows you to specify decimal places?
    *or is there an easy method to cast a string back to a double?Advice: Forgetting all this fooha with rounding, what in essence are you trying to achieve? Why all of this number manipulation in the first place? It will affect what should be the best answer.

  • 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

  • How to avoid Automatic Rounding of number column?

    In 10g 10.2.0.4 database I am seeing the below automatic rounding issue. How can I remove this automatic rounding.
    create table test (a number(28, 12))
    insert into test values (7051743.889999999665)
    select * from test
    Result:
    7051743.89
    But I want the result as what I entered i.e. 7051743.889999999665 so please guide how can I achieve this.

    But I want the result as what I entered i.e. 7051743.889999999665 so please guide how can I achieve thisWhat is your client? In SQLPlus you can use FORMAT:
    SQL> column a format 999999999999999.999999999999
    SQL> select * from test;
                                  A
             7051743.889999999665
    1 row selected.

  • Sample java program to round bigdecimal number to its nearest number

    hi,
    i want to round a BigDecimal number to its nearest number
    eg. if my calculation result is 75.3 then it has to be rounded to 75
    if my calculation result is 75.6 then it has to be rounded to 76
    if my calculation result is 75.5 then it has to be rounded to 76
    can anyone help me out resolving this
    thanks in advance

    public class MyBigDecimal {     
         public static void main(String [] args){
              double d = 75.3;
              System.out.println("d = "  +d + ", " + Math.round(d));
              d= 75.6;
              System.out.println("d = "  +d + ", " + Math.round(d));
              d=75.5;
              System.out.println("d = "  +d + ", " + Math.round(d));
              d=75.99;
              System.out.println("d = "  +d + ", " + Math.round(d));                    
    }What's the output?

  • 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.

  • Rounding After a Certain Number of Characters

    Hi,
    I'm looking for a way to round a number off after a certain number of characters. I'm not looking to round a number off after, say, the third or fourth decimal place, but after the third or fourth number. For example, If I round off after 3 characters, then:
    19235.6578 goes to 19200
    1.95723 goes to 1.96
    How would I go about doing this? Any help is much appreciated.
    Thanks,
    JOD8FY

    Thanks for your reply. What I'm really trying to do is round off an answer to the correct number of significant figures. According to the rules for multiplying significant figures, the answer will have the same number of sig figs as the number in the operation with the least number of sig figs. To do this, what I thought I would do is find the length() of the least precise number in the operation and then round off the answer after that many characters. So, if the least precise number has four sig figs, the answer will get rounded off after the fourth number. Hope this makes what I want to do a little clearer; sorry for being vague.
    JOD8FY

Maybe you are looking for