Home > Default > Round Up on Thousandths decimal using FormCalc

Round Up on Thousandths decimal using FormCalc

November 30Hits:0
Advertisement
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

Answers

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

Read other 4 answers

Tags:

Related Articles

  • Round Up on Thousandths decimal using FormCalcNovember 30

    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(perHou

  • Round 3 Digits before decimal in Chart and TableNovember 30

    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

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

    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 PR0

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

    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 decim

  • Round off to two decimal placesNovember 30

    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 AroraHi Nishant Arora, Please check this code. DATA: N1 TYPE P DECIMALS 4 VALUE '0.0565',            N2 TYPE

  • Rounding off to nearest decimal pointNovember 30

    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

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

    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 transa

  • Rounding Doubles to Two Decimal PlacesNovember 30

    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 numb

  • Rounding off to two decimal placesNovember 30

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

  • Rounding off to 2 decimal placesNovember 30

    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? ThanksThis works for all the test cases. Try this imp

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 1.074 s.