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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Views
Replies
Total Likes
I solved it myself......I only needed to add .004 to the main value----yes
Views
Replies
Total Likes