prtstat RSS value

Hi,
I new to solaris and I was assigned to make a script to check the memory usage of a particular server by checking the usage of some 400+ processes. Everything is fine except the RSS value of the prtstat command because some of the value are in megabytes and some are in kilobytes. I need them to be on the same because I want to get the average memory per day.

Now much question is is there are way/options that I can use to get a kB or MB output? Or do I need to convert them manually? Also any help whith getting the average is much welcome.

Any help is appreciated.

Thanks,
d

Perhaps use ps -o rss -p <pid> instead?