Re: Round to the nearest .5 value

2009-11-25 Thread Barney Boisvert
Assuming 'n' is your number, use #round(n * 2) / 2# For example: 3.21 * 2 == 6.42 round(6.42) == 6 6 / 2 == 3 3.31 * 2 = 6.62 round(6.62) == 7 7 / 2 == 3.35 cheers, barneyb On Wed, Nov 25, 2009 at 11:13 AM, Che Vilnonis ch...@asitv.com wrote: I'm trying to create a ratings system that

Re: Round to the nearest .5 value

2009-11-25 Thread Ian Skinner
Che Vilnonis wrote: Multiply number by 2, round it, divide it by 2. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive:

Re: Round to the nearest .5 value

2009-11-25 Thread Ian Skinner
Barney Boisvert wrote: 7 / 2 == 3.35 No it doesn't! I suspect your typing thumbs, or is it your ring finger, is making you look like a bad mathematician! ;-) ~| Want to reach the ColdFusion community with something they

RE: Round to the nearest .5 value

2009-11-25 Thread Che Vilnonis
Sweet! Many years ago, in high school Algebra class, I would have been able to figure that out. It's amazing what we forget. -Original Message- From: Barney Boisvert [mailto:bboisv...@gmail.com] Sent: Wednesday, November 25, 2009 2:23 PM To: cf-talk Subject: Re: Round to the nearest .5

Re: Round to the nearest .5 value

2009-11-25 Thread Allen Souliere
cfoutput #Round(3.21/0.5) *0.5# #Round(3.31/0.5) *0.5# #Round(3.61/0.5) *0.5# #Round(3.91/0.5) *0.5# #Round(4.24/0.5) *0.5# #Round(4.49/0.5) *0.5# #Round(4.50/0.5) *0.5# /cfoutput produces: 3 3.5 3.5 4 4 4.5 4.5 Cheers, Allen Che Vilnonis wrote: I'm trying to create a ratings system that

Re: Round to the nearest .5 value

2009-11-25 Thread Barney Boisvert
Oops, you're right, Ian. That should be 7 / 2 == 3.5 (remove the second three), of course. I wonder who had coffee this morning and therefore can't control his fine motor skills. At least with a computer your assertions are actually checked, so typos get caught. :) cheers, barneyb On

Re: Round to the nearest .5 value

2009-11-25 Thread Phillip Vector
That is beautiful in form and simplicity. Bravo. On Wed, Nov 25, 2009 at 11:27 AM, Ian Skinner h...@ilsweb.com wrote: Multiply number by 2, round it, divide it by 2. ~| Want to reach the ColdFusion community with something