5 Replies Latest reply on Feb 3, 2015 10:21 AM by DavidJondreau

rounding up and down to the nearest quarter

Title

rounding up and down to the nearest quarter

Post

HI

I'm looking to round to the nearest quarter dollar for a field. I've got a field that is calculating a price and I want to make another field that will take that price and round it to the nearest quarter dollar, or 50 cents, up and down. Is that possible?

• 2. Re: rounding up and down to the nearest quarter

Thanks. I did read that and was able to get the numbers to round down, or up. Is there a way to do both?

• 3. Re: rounding up and down to the nearest quarter

I don't follow what you mean. Do you want two calculations producing two different results, one that rounds up and one that rounds down?

• 4. Re: rounding up and down to the nearest quarter

My calculated field returns a dollar amount. I want to round it to the nearest quarter dollar. Not necessarily up or down, just the closest.

As an example, if the number returned was \$5.07, I would like the calculation to round down to \$5.00. If it were \$5.17, then it would round up to \$5.25.

• 5. Re: rounding up and down to the nearest quarter

Something like this?

Let([
value = 5.17 ;
quartered = value * 4 ;
rounded = round ( quartered ; 0 ) ;
result = rounded / 4
];
result
)