Round Up on Thousandths decimal using FormCalc

Currently I have a numeric object called perHour and one called, payPeriod.  I am using a FormCalc formula to round up to the 2nd decimal point (hundreth) based on the value in the 3rd decimal spot (thousandth).  Using this formula:  $ = Round(perHour, 2)  *  (what ever I want).  I have been asked to create a value that rounds the 2nd decimal spot (hundreths) up to the next digit value if the 3rd decimal spot (thousandths) is 1 or higher.
Example:  2.342345    using current code -----> 2.34 * (what ever I want)
               2.342345    New code (unknown) -----> 2.35 * (what ever I want)
Can anyone provide an answer???? Does this code involve the ceiling / floor concept. ----Allen

Javascript is so much cuter and I am not good with formcalc
Try this one. It will round till 999 (f.ex 333 -> 300) normally and after 1000 upwards to the next thousand (1001 -> 2000)
You can also add Text like in the lower case if you take a Textfield.
var a = NumerischesFeld1.rawValue;
var b = a;
if (a < 1000)
a = Math.round(a/100);
a = a*100;
this.rawValue = a;
if (a >= 1000)
b = Math.floor(b/1000);
b = b * 1000;
if (b < a)
b = b + 1000;
this.rawValue = b + " what ever you want";
Hope I got you right.
Lisa

Similar Messages

  • Round 3 Digits before decimal in Chart and Table

    Hi Guys,
    Do you know where I can find the option/property in the chart and table to round 3 digits before decimal. Refer snapshot below:
    For example, in below case Y axis original value is 40,000, 80,000 etc. but it should show on the graph and table without '000' 
    Thanks.
    Warm Regards Badal Ratra

    Hi Badal,
    After testing the issue in my local environment, we can refer to the following steps to achieve your requirement:
    Right-click the vertical axis (or textbox in table) to open the Vertical Axis Properties (or Text Box Properties) dialog box.
    Click Number in the left pane, then select Number under Category group.
    Set “0” as Decimal places, select “Use 1000 separator (,)” and select “Show values in” with “Thousands”.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Price per unit is getting round off to two decimal places.

    Hi Gurus,
    In the Billing output, the Price per unit is getting round off to two decimal places.
    How can we avoid this or allow 4 decimal places for such cases.
    In the same pricing procedure, we have two pricing condition types PR02 and ZR01.
    When PR02 is being used,it doesnt rounds off Price per unit.e.g .578888 = .578888
    But when ZR01 is being used the system rounds off price per unit.e.g.578888 = .58
    Please suggest where is the setting for it.
    Thanks
    Montee

    Hi,
    Which currency you are using? If its INR, then it will do only for 2 decimal places.
    The solution for ur problem can be ractified by changing the scales :
    Also check OSS 80183
    Thanks,
    Raja

  • How do I round calculations to two decimal places (form-wide)

    Hi,
    I've created an order form where customers input the quantity of product they want to order and the form outputs the total due (including shipping and sales tax). Depending on user input, the resulting total sometimes contains more than two decimal places. How do I round calculations to two decimal places? Is there a way to do this form-wide?
    I'm new at using Acrobat for calculations. Any help would be greatly appreciated! Thanks...

    The above will affect the displayed value not the actual value of the field nor its value when accessed in another computation. This behavior may cause an error of 1 cent or more in the grand total or sales tax computation. If you want the the value and displayed value to be the same value you can use the following Validation script:
    event.value = util.scand("%,1 0.2f", event.value);

  • Round off to two decimal places

    hi
    i have a filed in it values are there i want to round off to two decimal places
    which is the function module for it please suggest
    regards
    Arora

    Hi Nishant Arora,
    Please check this code.
    DATA: N1 TYPE P DECIMALS 4 VALUE '0.0565',
               N2 TYPE P DECIMALS 2.
    MOVE N1 TO N2.
    WRITE: N2.
    Here the value is get rounded to 0.06.
    Rather than function modules you go with this. I think it is easier.
    Reward points if useful.
    Cheers,
    Swamy Kunche

  • Hiding Pages in ADOBE form using formcalc scripting.

    Hi Experts,
    I am new to ADOBE form and currently working on invoice print output. (NOT an  Interactive adobe form)
    My requirement is
    i wanted to print one main page and 5  different annexures(anexures are having different layouts so is in diff forms and contained in diff pages)
    Deppending on 'Oreder reason' (made as global variable)  , i need to select appropriate annexure and print
    main page and any one of the annexure.
    so i should hide all other annexure, to achive this i used formcalc scripting.
    i tried hiding annexure 2 by following code,
    data.Annexure2::ready:form - (FormCalc, client)
    if ( data.G_F_ORDER_REASON.rawValue == "ANX" )
    then $.presence = "hidden"
    endif
    i have passed value 'ANX' to this , i could see the value of order reason printed on page Annexure2 but it is not executing (getting in to if condition) condition and not hiding the page ...
    Experts please help me...
    this way i have to hide 4 other annexures...please help me or give me some other option to achive this.
    thanks and regards
    varun
    Edited by: skyblue on Aug 6, 2011 3:30 PM

    coding Formcalc is a pain.
    But you're doing the right thing by passing in a variable and hiding based on the content of it.
    Here's an example of where I'm hiding a subform on a page.
      if ( main_sf2.charter_only.CHARTER_DOC.rawValue eq "X" ) then
       main_sf2.pts_sf.presence = "visible"
      else
       main_sf2.pts_sf.presence = "hidden"
    endif
    Looks like your code is similar - try changing
    ( data.G_F_ORDER_REASON.rawValue == "ANX" )  to
    ( data.G_F_ORDER_REASON.rawValue  eq "ANX" )
    or instead of $.presence = "hidden"  fully qualify the name of your page to  data.Annexure2.presence = "hidden"

  • How to dynamically assign Display Pattern using FormCalc in Adobe PDF Form

    I am using Adobe PDF Form Designer. I am trying to dynamically assign a display pattern like MM/DD/YYYY to the Field tab - Display Pattern property. May I know how to do that?
    I am using FormCalc scripting.

    hi,
    After placing the date field in layout from data view, u will get tabs like field,layout,border etc..
    In field tab under the edit pattern specify the pattern in which you want to display the date field.
    hope this works.
    Reward points if helpful.

  • Opening new window from a pdf using Formcalc and gotourl

    Hello,
    I am trying to open a new browser window using Formcalc and gotourl.  We are using Livecycle Designer ES2 9.0
    Previous versions of Designer had an extra parameter at the end such as :      
         xfa.host.gotoURL(<url>, 1)  or  xfa.host.gotoURL(<url>, 0)
    But in 9.0 the second parameter is removed , so I'm left only with
         xfa.host.gotoURL(<url>)  and this replaces my form rather than opening a new window.
    Our company restricts the use of Javascript with Adobe so I am left with Formcalc to accomplish what I need.
    Does anyone know why the second parameter was removed in 9.0  and/or if there is a way to accomplish what
    I need in 9.0 without using Javascript?
    Thanks,
    Norm.

    Hi,
    if you cannot use JavaScript because it is deactivated, then FormCalc won't work also.
    I don't know why the 2nd optional parameter has been removed. Here is an explaination of it.
    http://help.adobe.com/en_US/livecycle/8.2/lcdesigner_scripting_reference.pdf#page=382

  • Using FormCalc to Automate Date Calculations

    How do I use FormCalc to add days to a date and automatically calculate a second date?

    Thanks for the feedback, but I've checked this out in depth before coming to this discussion group. It does not show me how to calculate the date as I need it. I have a timeline document where users will enter an initial date. Based on the initial date, I want to automatically calculate the milestone dates by adding the number of days in wait time. For example, the user will enter Jan 1, 2013. The first milestone should occur 3 days later, so the calculation would add 3 days to the initial date and automatically return a date of Jan 4, 2013. There are a number of milestones and automatic dates that occur throughout this 80-day timeline.
    Do you have any idea of what that calculation would be?

  • How to display today date using formcalc

    Hi all,
    how to display today date using formcalc, eg April 20, 2009?
    Thanskks

    Num2Date(Date(), "DD/MMM/YYYY", "de_GB")

  • Object references using FormCalc

    Hello
    Does anyone know of the FormCalc equivilant to the following javascript code?
    var a = event.target.getField("form[0].page[1].field1");
    Basically what I am doing is manipulating the data in field1 form several other fields. The other fields all use FormCalc, to do some calculations.
    For example say field2 has the following javascript:
    var a = event.target;
    var lcv;
    var total = 0;
    for (lcv = 0; lcv < 10; lcv++)
    total = total + a.getField("form[0].page[1].field1["+lcv+"]").value;
    I would like to do the samething using FormCalc (I have some other fields that use FormCalc to do stuff, but I need to also do the same kind of sumation) without having to hard code all the fields.
    Thanks
    Ben
    P.S. if you know the synax for a for loop in FormCalc that would be helpful also, but not critical since I can use a while loop.

    Chris,
    I did not think FormCalc supported what I needed but I was hoping I was wrong and therefore hoped to avoid having to query the field directly because the area I am working over basically equates to a 2 dimensional array (but its is not actually one) with a considerable number of fields, I was hoping not to have to hard code the field names for direct access, but if I must, I must, since in need FormCalc functions in part of my validation ( I use parse and format, as well as R&Ltrim) before the calculations.
    I check page 23 for the FormCalc reference guide which comes with 7.0 and it talks about how to access elements in a tree, not the syntax of a for loop. If you have a simple example that would suffice.
    Thanks
    Ben

  • Rounding off to nearest decimal point

    i have these values
    35.2
    35.3
    35.4
    35.5
    35.7
    35.8
    35.9
    36.0
    i am looking for indexes closet 35.74 in my array. (which is index 4.)
    i used the "round to nearest" function and it gave me 36.
    which is index 7.
    what other ways to get the right index?
    Solved!
    Go to Solution.

    You will always have some difficulties with rounding to a specific number of digits after the decimal point because of the way numbers are represented in binary. When expressed in binary 0.1 is an infinitely repeating expression. Regardless of the display the internal representation of the number always uses the maximum resolution for the data type (8 bytes for DBL).
    So you need to be very careful to define exactly what you  want. If you have an array of values (regardless of the way they are displayed) Then you can find the closest to a Test Value by subtracting Test Value from the array and finding the minimum of the absolute values of the differences.
    Note that in the image below the same values are in Array and Array 2 with the display on Array 2 set for 20 siginficant digits. 
    Lynn

  • Rounding Rule upto 3 Decimal Places in Tax Condition(SABRIX)

    Hi,
    We are Using SABRIX for Tax determination and need to round up Condition Type XR1- XR6 to round upto 3 Decimal Places.
    Do we need to To Change ALT Calc Type- 301306or Alt Cond Base Value -- 16  or have to change Currency  decimal Places in transaction OY04/OY03.
    Kindly Suggest.
    Thanks
    Amit

    Hi,
    Tax % for customer is decided in SABRIX, Where does TaX calculated?? In SABRIX or in SAP.
    Thanks
    Amit
    Edited by: AMIT GUPTA on Mar 31, 2010 10:54 AM

  • Rounding Doubles to Two Decimal Places

    Hi All,
    I've searched the archive and found a few different posts regarding restricting the number of decimal places in doubles. However they all suggest different methods, BigDecimal, NumberFormat etc.
    Which is the simplest method of rounding a number say 10.023445656 to 10.02?
    I tried using the java.text.NumberFormat but this turns the double into a string and I need the end result to be a double.
    Thanks

    Hi All,
    I've searched the archive and found a few different
    posts regarding restricting the number of decimal
    places in doubles. However they all suggest different
    methods, BigDecimal, NumberFormat etc.
    Which is the simplest method of rounding a number say
    10.023445656 to 10.02?
    I tried using the java.text.NumberFormat but this
    turns the double into a string and I need the end
    result to be a double.
    ThanksI ahve a small code that can do the work for u:
    import java.text.*;
    double format(double val, int dec){
        double multiple=Math.pow(10,dec);
        val=Math.round(val*multiple)/multiple;
        DecimalFormat df=new DecimalFormat("0.00");
        String format=df.format(val);
       double dval=Double.parseDouble(format);
       return dval;
    }//end of functionHope that helps!

  • Rounding off to two decimal places

    Hello,
    For simplicity, is there a method which will round off
    a double variable to two decimal places.
    Excample: if I have a result which equals 2.1999998
    and I want to display this as 2.20 in a TexTField.
    Any help would be much appreciated.
    Thanks

    If you are trying to do dollars and cents, I further recommend you use:NumberFormat currencyFormatter = NumberFormat.getCurrencyInstance();
    String currencyOut = currencyFormatter.format(yourNumber);to format your numbers as they will give the correct precision for international currencies simply by setting the locale, and they will also automatically handle the currency symbols ($, DM FR, etc.)
    Doug

Maybe you are looking for

  • I am on a plan for Photoshop CC but I need a serial number?

    I am on a $10 a month plan that should give me access to adobe Lightroom and Photoshop CC. Lightroom opens easily enough, but for two months I have been completely unable to open Photoshop. When I try it tells me my trial has expired and I need to re

  • I can't connect to iTunes as it stops working when my iPod touch is plugged in, please help!

    i backed up and restored my iPod and now when I plug it in to put my things back on my iPod touch, iTunes stops working and the programme closes please help soon!

  • AIR Debug Launcher Does NOTHING in cs5?

    Hi All, Running Flash cs5, windows 7 64bit I go to test my movie in Flash cs5 no actionscript errors etc.. but it just hangs.. air debug laucher doesn't launch.. nothing happens AT ALL.. as documented here: http://www.kirupa.com/forum/showthread.php?

  • Panning image script

    Hello all, I am writting a new post about the same issue, sorry for that, but i really need help, Finally, i am using the following code for panning a big image in my flash as3 project : function panThisImage(target:MovieClip, speed:Number,speed1:Num

  • Capacity Levelling

    Hi Can anybody send me a end user manual or step by step process on how to do Capacity Leveling . Thanks for all your efforts in advance . Regards Kurna