I have a set of data that contains positive and negative numbers. I would like 12.5 to round to 13 and -1.5 to round to -1. When I use the round([number],1) function, 12.5 goes to 13 but -1.5 rounds to -2.Thanks!
@jessy_chow You can use
CEIL([Field1])
Do you want the rest of the numbers to round normally? Meaning do you want -1.6 to round to -2?
If so, you're really just specifying one special case and we can do this with a conditional.
if [Number]<0 && [Number]-floor([Number]) = .5then [Number]+.5else round([Number],1)endif
Should do the job though there might be a more elegant way.
Is this in Designer Desktop, or Designer Cloud? I am not sure how it works in Designer Cloud.
In Designer Desktop, Round([Field1],1) enacted on [Field1] as a Double works as you have said you would like. I actually answered a question on this the other day and found that's exactly how it works. I'm not sure how you're getting -2.
See the help here for details.
Hi you can use the formula IIF([Number] >= 0,Floor([Number] + 0.5),Ceil([Number] + 0.5))
attached an screenshot for the same.
@jessy_chow use @aatalai 's method: