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

Similar Messages

  • 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

  • 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

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

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

  • 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");
         }

  • Rounding off to 2 decimal places

    Hi,
    I use "Double" for my calculations and since I am working with $$ ;-) I need to round it off at 2 decimal places. Any quick way to do this? or do I have to write some major code for that?
    Thanks

    This works for all the test cases. Try this
    import java.math.BigDecimal;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    class RoundOff {
         public static void main(String args[]) {
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.8"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.98"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("-1.0"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("-1.0"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("-141.036"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("-00.1"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("-0.0"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.98"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.0.54"));
              //RARE EXCEPTIONS BUT WONT OCCUR
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("0125."));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("0125.979.79E"));
              //RARE EXCEPTIONS BUT WONT OCCUR
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.2354"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.9874"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.999"));
              System.err.println(" FINAL OUT PUT >>> " + formatPrecision("173449.999"));
         private static String formatPrecision(String s) {
              if (s == null || s.trim().length() == 0) {
                   return "0.00";
              try {
                   if (Double.parseDouble(s) == 0) {
                        return "0.00";
              catch (java.lang.NumberFormatException nfe) {               
                   return s;
              double d = 0.00;
              int ind = s.indexOf('.');
              String dec = "";
              if (ind > 0) {
                   dec = s.substring(ind);
                   if (dec.length() == 1) {
                        s = s.concat("00");
                        return s;
                   if (dec.length() == 2) {
                        s = s.concat("0");
                        return s;
                   if (dec.length() == 3) {
                        return s;
              if (ind == -1) {
                   return s.concat(".00");
              try {
                   d = Double.parseDouble(s);
                   BigDecimal bd = new BigDecimal(d);
                   bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP); //2 decimal places
                   d = bd.doubleValue();               
                   NumberFormat formatter = new DecimalFormat("0.00");
                   return String.valueOf(formatter.format(d));
              catch (java.lang.NumberFormatException nfe) {
                   return s;
    }

  • Rounding numbers to 2 decimal places

    Hello programming community,
    I have the following code to round my answers to 2 decimal places:
    double roundedValue;
    DecimalFormat twoDForm = new DecimalFormat ("#.##");
    roundedValue = Double.valueOf(twoDForm.format(value));The code works great and what i expect it to do. When I pass in really big decimal numbers (2.55555668) it correctly rounds it (2.56) but when it rounds the number and the last decimal is a zero it does not display this. (if the number ends up rounding to 4.50 , i want it to display it this way but it ends up getting rid of the 0. )
    If anyone has any ideas for a way to fix this please let me know.
    Thanks.

    the-java-guy-needs-help wrote:
    i thought that my equation would be causing a problem and that i might need to do a cast -- I relized that this is not the problem
    for the type of string i am using the ("0.00")
    After trying various things the string does work if im just outputing it to the screen but i also use this rounding in a method that needs to return a double so i still need to convert it to a double.
    I have tried various ways of converting string to double (Double.parseDouble) and i tried one that involved a trim() but both methods drop the zero.You've got a basic misconception still going on here. If you convert it to a double, there is no such thing as a trailing zero -- it's meaningless since it only has meaning for a String representation of a double and not the intrinsic number itself.

  • Round to 2 decimal places

    hello guys,
    I have a table. One column of the table displays the scores.
    ex: 2.2222222233333
    2.32232323
    I want to round all the numbers in that column to 2 decimal.
    Result needed: 2.22
    2.32
    Can you please help me how can i get handle to the column and round the numbers to 2 decimal places.

    Boris,
    1) You mentioned "i tried finding out the VO", I am not sure how you checked it.
    Enable diagnostics then you will get a link in the Bottom left corner called "About this page",
    click on that , and expand it, you can see the page structure there, there you can find the attached VO with your table region.
    Or
    begin
    jdr_utils.printDocument('<your page path like /oracle/apps/per/....PG>');
    end;
    Which will give the PG.xml you can load the page in Jdeveloper(with the same package)
    and you can have a look at the page structure in the page, which will give details about what VO is attached to your table region.
    2) Yes you are right, you cannot round the null value
    3) What page you are trying to get round the value, is it the FinalAppraisalPG?
    Give me the full navigation,
    Thanks.
    With Regards,
    Kali.
    OSSI.

  • Losing Decimal Places

    I am having problems with SQL Developer rounding my decimals. The column is a NUMBER(11,6), but SQL Developer rounds the number to 3 decimal places. SQL Plus shows the data just fine, but both the data view and the SQL Worksheet in SQL Developer round it to 3 places. Is there a setting that I am missing?
    Thanks.

    You are not missing anything - it is a bug. We have fixed it in development and will include that fix in a second patch.
    -- Sharon

  • Rounding to a decimal place

    like, right now i have this huge equation;
    double heatIndex8 = (-42.379) + (2.04901523 * birmingTemp[7]) + (10.14333127 * birmingHum[7]) - (0.22475541 * (birmingTemp[7] * birmingHum[7])) -
                             (6.83783 * Math.pow(10, -3) * Math.pow(birmingTemp[7], 2)) - (5.481717 * Math.pow(10, -2) * Math.pow(birmingHum[7], 2)) +
                             (1.22874 * Math.pow(10, -3) * Math.pow(birmingTemp[7], 2) * birmingHum[7]) + (8.5282 * Math.pow(10, -4) * birmingTemp[7] * Math.pow(birmingHum[7], 2))
                             - (1.99 * Math.pow(10, -6) * Math.pow(birmingTemp[7], 2) * Math.pow(birmingHum[7], 2))and it prints out an insane amount of decimal places...
    how can I tell the code to round(heatIndex8) to the tens place?

    paulcw wrote:
    Use a java.text.DecimalFormat, or one of the printf methods that are now all over the place. (Well, String and java.io.PrintWriter and PrintStream, in particular).
    By the way the size of the equation doesn't have a lot to do with it.
    Edited by: paulcw on Feb 2, 2008 1:23 PMI know it doesn't, but I just really hate it.
    decimal format you say? I'll go check that.

Maybe you are looking for