I am trying to split a number into years and months, but Mod operator does not want to play. I basically want to get the average age in a format of x yrs and x months rather than yrs.fraction of year. It may just be the fact I have a long day and I am doing something silly.
[code]yr=avgage/listbox1.listcount 'avgage is a total of all ages, listcount is the number of entries, gives an iteger correctly of year
yr=avgage\listbox1.listcount ’ gives me say for example 41.24, 41 years and .24 of a year, roughly 3 months
mth=avgage mod listbox1.listcount 'does not give me the .24 as above as I would expect, it gives me 680?, which I can then multiply by 12 to get months
[/code]
How much is avgage?
How much is listbox1.listcount?
By the way why is avgage the total of all ages, while a reader would interpret this variable as average of ages?