January 3, 200224 yr I wrongly posted these request to the Left Brain Forum. I think it belongs here. Hello Can someone help with what should be a simple calculation? I sell material by the square foot. Any amount greater than a whole number needs to be rounded up to the next whole number. If the result is 10.1 I need the result to be 11. Thanks alot.
January 3, 200224 yr I would round off the number first, from 10.1 to 10 for example (use the Round function, and set precision to 0). 10.5 and higher will go to 11 10.4 or lower will go to 10 so... have your calc field first round it off, and then wrap it all in an IF statement where if the result is LESS THAN the original, it adds 1 to the amount, and if the result is more than the original, it adds 0 (or uses the rounded amount) I would do this in a separate Calc field, and not reset it the original field. Extra memory, but easier to chekc for errors if the original field is left alone. Here's the Calc: If(Round(number_original, 0) >number_original, Round(number_original, 0), Round(number_original, 0) + 1) number_original: is your primarty field number_rounded: is the Calc field (result) Sharka
January 3, 200224 yr Since you're talking about building materials, negative numbers are not an issue, so this will work: Case(Number - Truncate(Number, 0) != 0, Truncate(Number, 0) + 1, Number) If you wanted it to work with negative numbers, then this will work: Case(Number - Truncate(Number, 0) != 0, Case(Number < 0, -1 * (Abs(Truncate(Number, 0)) + 1), Truncate(Number, 0) + 1), Number)
January 3, 200224 yr Author quote: Originally posted by rdhaden: Since you're talking about building materials, negative numbers are not an issue, so this will work: Case(Number - Truncate(Number, 0) != 0, Truncate(Number, 0) + 1, Number) If you wanted it to work with negative numbers, then this will work: Case(Number - Truncate(Number, 0) != 0, Case(Number < 0, -1 * (Abs(Truncate(Number, 0)) + 1), Truncate(Number, 0) + 1), Number) Thanks for the quick reply
January 3, 200224 yr Either of these will work: roundUp1(calc,number) = Int(number) + (Int(number) < number) roundUp2(calc,number) = Round(number + .49999999, 0)
Create an account or sign in to comment