Subject Re: Convertion
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 03 Jul 2015 10:38:41 +0200
Newsgroups dbase.getting-started

On Fri, 03 Jul 2015 09:05:36 +0200, ken <gkent_28@yahoo.com> wrote:

> hi ,
> is there a better way to covert the following numbers more easily?:
>
> from:                                 to:
> 59                                      55
> 56                                      55
> 51                                      50
> 43                                      40
>
> etc ....
>
> all number are I think converted to the nearest 0 and or 5.
>
>
> thnx and God Bless
>

I don't know if it's better or not as you don't say what you've used  
previously. :-)


int(num/5)*5 will give you the converted values that you show.  These are  
not the "nearest" but rather the "highest lower" values that end in 0 or 5.

The "nearest" to 43 would be 45.  To convert to the "nearest" value ending  
in 0 or 5 use

iif(mod((num/10-int(num/10))*10,5)>=3,(int(num/5)*5)+5,int(num/5)*5)




59.00      55.00      60.00
56.00      55.00      55.00
51.00      50.00      50.00
43.00      40.00      45.00



Mervyn.