Rounding up to nearest whole number question

I have a calculation script that sometimes returns a decimal result. How would I create a script that would round that decimal up to the next whole number? Anyone have any idea's?

okay, I am not very good with this. That command is new to me. Where would I place that script if I already have a javascript script in the calculate event of that numeric field I am trying to get rounded up?
I basically have the javascript code in the numeric fields calculate event set to
this.rawValue = subform1.numericField1.rawValue;
I tried putting your script on the change event hoping I could use formCalc there but get a error when testing saying Ceil is not defined. Thanks

Similar Messages

  • Rounding off to nearest whole number without condition

    hi,
    i want to round a real number to an integer value,,wihout any conditions like
    10.01 should be 11
    10.1 should be 11 and like that
    is it posible to do it?
    thanks in advance.
    amit

    It doesn't look like you are trying to round to the nearest whole number here. It looks like you are trying to find the smallest integer value that is greater than or equal to the real number. If so, you would want to use the CEIL function (i.e.
      1  SELECT CEIL(10.01)
      2*   FROM dual
    SCOTT @ hp92 Local> /
    CEIL(10.01)
             11Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Formula rounding to nearest whole number

    Hello,
    I have created the following formula ( Metrics."# of Leads Resulting in Won Opportunity"*100 /Metrics."# of Leads" ) and displayed the results in percentage but it looks to round to the nearest whole number does anyone know why this might happen. Also i am using 2dp in the results i am hoping to get the actual result rounded to 2dp and not the nearest whole number.

    Hi !
    I think that if you add the ROUND function, this will work... :
    ROUND(Metrics."# of Leads Resulting in Won Opportunity"*100 /Metrics."# of Leads", 2)
    Hope this will help, feel free to ask more !
    Max

  • Rounding text size to nearest whole number?

    I've had to rescale some artwork, but now I'm left with type sizes that are 71.68px tall, 34.51px tall, etc.
    Is there a script that'll snap all the text in a document to it's nearest whole number or 0.1 decimal?

    // rounds the size of text in all textFrames in your document
    var aTFrame = app.activeDocument.textFrames;
    for ( i = 0; i < aTFrame.length; i++ )
    var fractionSize = aTFrame[i].textRange.characterAttributes.size;
    var RoundedSize = Math.round(fractionSize);
    aTFrame[i].textRange.characterAttributes.size = RoundedSize;
    redraw();
    This will do all the text frames. Copy the above, paste it into a text editor or the Adobe ESTK (ExtendScript Tool Kit) and save as a plain text file with a .jsx extension. Place it into Applications/Adobe Illustrator CSX/Presets/en_US/Scripts folder and restart AI. Run it by having a document open in AI and call it from File>Scripts>scriptname.

  • Always round up to nearest whole in APO DP

    Hi
    there is a requirement to always round up data to nearest whole number. number should be always rounded above and not rounded down.
    Example a value of 0.07 should be rounded to 1
    a value of 1.25 should be rounded to 2
    a value of 1.75 should be rounded to 2
    a value of 1.07 should be rounded to 2
    and so on
    Is there a way i can achieve in APO DP by some settings/paramater/config/macro/exit etc etc - i am on SCM 7.0
    Thanks,
    TJ

    Tejinder
    Try using the CEIL() function in a macro.
    Rishi Menon

  • Rounding to a whole number

    What is the proper syntax for rounding to a whole number.  In my spread sheet I have a function set up to apply a divisor to cost, in this case  = F7 $625 / G7 .65 = $961.54.  I simply want the number to round to the nearest whole dollar amount  $962.00

    Hi ghemmen,
    or you could just do with formatting.
    quinn

  • Rounding a percent to a whole number

    Hello,
    I'm still fairly new to performing script calculations and with this particular one seems a bit more complex for me.
    I'm trying to determine the percent difference between 2 numbers and display the percentage as a whole number. Logically my calculation looks like
    (numericField1 - numericField2 / numericField1 * 100)
    (ex. 1000 - 850 / 1000 * 100 = 15%)  
    I need assitance with my calculation and especially rounding the % to a whole number. I would not like any answers displayed like 22.66666%
    The code below is somethig I tried
    event.value = roundNumber( ( this.getField(numericField1).value - this.getField(numericField2t).value  )  / this.getField(numericField1).value , 2 ) + '%';
    function roundNumber(num, dec) {
            var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
            return result;
    Any advice would be great!

    Actually Adobe makes this really simple for you.  If you use a numeric field to display the result, the display pattern for the field will control how the number is shown.  You can set a percentage pattern:"num{zzzz9.99%}" to control how many digits will be displayed, and how many digits will be significant past the decimal point.  If there are more digits, Adobe will automatically round the number.  In the attached example I used the pattern
    "num{zzzz9%}" to ensure that only a whole number will be displayed.  Adobe will use normal rounding rules: 0-4 rounds down, 5-9 rounds up.
    Additionally, the percentage pattern will automatically multiply the field value by 100, so you don't need to do that in your script.
    For the example attached, I added your calculation as FormCalc script to the Calculate event of the result field.  The script is now simply:
    (NumericField1 - NumericField2) / NumericField1
    Adobe takes care of the rest.

  • Rounding of Qty to the nearest whole no in PO

    Hi All,
    We have material whose base unit of measure is say centimetres. and it has purchase unit as metres.
    Our requirment for procurement is generated through MRP run which creates the Purchase requistion and in PR the UOM considered is the base unit of measure  ie centimetres.
    When this Purchase req is converted to Purchase Orders we get qty sometimes in decimals  for ex: if in Pur req the qty is 150 centimetres , in PO it is shown as 1.5 metres.
    Is there a way for rounding of 1.5 to 2.0 metres in PO (means to the nearest whole no) automatically.
    Thanks,
    Vengal

    in MRP view of material master you have two fields to care about rounding. rounding profile and rounding value
    http://help.sap.com/saphelp_46c/helpdata/en/f4/7d28c844af11d182b40000e829fbfe/content.htm

  • Whole number rounding off in bom

    is it possible not to round off whole numbers in the bom component quantity? for example, when i input the number 8.000, the system rounds it off to just 8.

    Hi,
    Please let know your unit of measurement.
    Goto CUNI set the Decimal places and decimal pl.routing = 3 for your unit .
    Now try with decimal places at BOM.
    If your unit is related to whole number like Nos, EA system will give warring message.
    Pradeep

  • I have a calculation in a5 and need the answer rounding up to the next whole number

    I have a calculation in cell a5 and need the answer rounding up to the next whole number

    Hi,
    I am using numbers
    A1 x A2 = A3       A4 is A3 divided by 2.88.  Indeed to round up the answer in A4 to the next whole number
    Eg 4.5 x 3.7 = 16.6 sq meters as an area , divided by 2.88 ( area of 1 board) = 5.78 boards so I need to buy 6 and quote for 6
    Cheers

  • How to return whole number using round function

    hi
    can i get sql query using round function how to return whole number value

    Hi welcome to the forum. if you want whole number value what does it mean
    1. whether you want the whole number greator than or eqaul to that number example for 12.6 you want 12 or 13
    see below example
    1.  SQL> select round(12.5) from dual;
    ROUND(12.5)
             13
    2.  SQL> select round(12.4) from dual;
    ROUND(12.4)
             12
    3.  SQL> select floor(12.5) from dual;
    FLOOR(12.5)
             12
    4. SQL> select floor(12.4) from dual;
    FLOOR(12.4)
             12
    floor will always give you a round value which is a integer or whole number less than or equal to but output of rond will differ if the value is greator than 12.5 it will give 13 but if it is less than 12.5 it will give 12, so depending on your requirement you can choose which function to use. similarly if you always want to get the whole number greator than the number you can use ceil as below
    SQL>  select ceil(12.3) from dual;
    CEIL(12.3)
            13
    SQL>  select ceil(12.8) from dual;
    CEIL(12.8)
            13

  • Java's Defualt Literal Types (Whole number literals defaults to int?)

    Hello guys, its my first Post here, just want to ask
    is java whole number literals defaults to int?
    check these codes
    ---code 1:---
    Java Code:
    1
    byte b = 10;
    //code 1 works
    ---code 2:---
    void someMethod(byte a,byte b)
    System.out.println(a+b);
    then I use it
    someMethod(10,5);
    //code 2 doesn't work, it yields an error
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method sum(byte, byte) in the type Test is not applicable for the arguments (int, int)
    now these are my questions
    1. does java whole number literals defaults to int? (I think so, basing on the code)
    2. if question no. 1 is true, then why code 1 worked? it shouldn't right, coz its a downward cast (from int to byte).
    3. what really happens under the hood?
    by the way, the jdk version I used is 1.7.0
    Thank you guys in advance

    915343 wrote:
    Hello guys, its my first Post here, just want to ask
    is java whole number literals defaults to int?Yes.
    1
    byte b = 10;
    //code 1 worksThe literal expression *10* is an int. But it's a compile-time constant that fits into a byte, so the assignment is okay without a cast.
    ---code 2:---
    void someMethod(byte a,byte b)
    System.out.println(a+b);
    then I use it
    someMethod(10,5);
    //code 2 doesn't work, it yields an errorBecause 10 and 5 are ints, not bytes, and there's no method that can take int as args. The automatic narrowing conversion that takes place for assignment does not come into play when finding a matching method signature.
    1. does java whole number literals defaults to int? (I think so, basing on the code)Yes.
    3. what really happens under the hood?Read the JLS for those details.
    http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10
    http://java.sun.com/docs/books/jls/third_edition/html/conversions.html
    http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.12
    Edited by: jverd on Feb 17, 2012 3:49 PM

  • % formating if a whole number is inputted

    Hello:
    I have a numeric field on my form. I clicked on the field, went to the "Cell" tab clicked on "Patterns" and in the "Display" tab set my pattern to " num.percent{} "
    My problem is that my user wants it to display 10% when they key in "10" (whole number) currently keying in "10" displays 1,000%.
    So far the only way to display 10% is by keying in ".10". I understand why .10 gives me 10% but the behavior of the users will be to key in a whole number.
    What is the best way to solve?
    Thanks,
    Keith.

    That worked perfectly in fact I ended adding to it num{99.99'%'} to display less than 1 percent values.
    I do have another quick question. In another field where I have dates. I have the following setting in the display pattern:
    date{MM/DD/YYYY}
    My issues is that it will only format/display if I click the calendar pop up and select a particular day. That is to say if I was to input the date manually like 06262008 or 6262008 it would display the number like I just inputted not in the display pattern that I had set (06/26/2008)
    Any more ideas how to solve?
    And thanks very much :-)
    Keith.

  • How to add 2 decimal places if the number is whole number(Integer)

    Hi Gurus- I had a requirement to add the zeros for two decimal places even the number is an whole number.
    Example: I had a column which i gave the datatype as Number(8,2) .While Inserting from the flat file to the custom table column,i am rounding it to 2 decimal places.But if its the whole number i want that also to be rounded to 2 decimal places.
    1) 3456.89675 It's getting inserted as 3456.89
    2) 123 It's getting inserted as 123 (Instead i want this to be inserted as 123.00)
    3) 123.50000 It's getting inserted as 123.5 (Instead i want this to be inserted as 123.50)
    Can you please let me know how can i achieve it to insert any number(decimal or whole number) from the flat file as 2 decimal places in the custom table column.
    Thanks in advance.

    Please do not post duplicates -- To update the date for the first of the month

  • How to get only the whole number omitting the decimals

    Hi Experts,
    I want to get only the whole number of a output field. For example  i am getting an output as 8.766 , i need only the value 8 .
    I checked by moving the values to integer field but i am getting the rounding value 9 .
    I want only the whole value 8.
    Please help me out..
    thanks & Regards.
    Reena..

    Hi Reena,
    Unfortunately when you assign a packed number to a character, numeric or even a packed no without a decimal value SAP does a internal conversion of rounding these value. So direct assignment would won't work for your case.
    You can use the following logic instead for getting the whole number.
    DATA : LV_VAR1 TYPE STRING,
                LV_VAR2 type p DECIMALS 3 value '8.766'.
    LV_VAR1 = lV_VAR2.   " LV_VAR1 would contain 8.766 without rounding.
    write  : LV_VAR1(1).   " LV_VAR1(1) contains 8 which you can assign to any target variable.
    I think there is no addition so as to avoid this internal rounding.
    Try and let me know if it works for you..
    Cheers
    Ajay

Maybe you are looking for

  • Odbc on windows xp pro

    I have to access an 8i (8.1.7) server from a win xp pro client. the cd i have is for nt/2000 and refuses to do anything on xp. i have downloaded the odbc driver and installed it (ora8177.exe). When i go to the administrative tools and try to add a ne

  • FTP adapter  (10.1.3.3) on Solaris

    Hi, I am trying to setup ftp adapter (10.1.3.3) on solaris with sftp set to true. I made all the necessary configuration changes to $ORACLE_HOME/j2ee/oc4j_soa/application-deployments/default/FtpAdapter/oc4j-ra.xml. Following properties are updated in

  • Canvas view shows only blank cavas

    When I went to re-open a file I was working on during my last session, I am now unable to view any of the the objects in the "editing" view of Xcelsius.  The canvas is completely blank (basic blue background, no grid showing). However, when I go to p

  • HCM Transfer process - Authorization Check Failed

    Hi All     We are trying to run the Standard Transfer  process of HCM . We are trying to run the tcode u201C HRASR_TEST_PROCESSu201D  Can anybody Tell us what authorization objects does a user  require to run this process if the user does not have SA

  • Difference between the shop papers

    Please specify the difference between operation ticket and time ticket? Also between material issue slip and pick list?