Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert bytes to megabytes & Round the results 1

Status
Not open for further replies.

bbsid

MIS
Nov 13, 2002
1
US
I'm using Track-It database. My boss wants a list of all computers, P3, 866 and higher that have less than 512MB of RAM.

Got the results but now trying to tweak the report into results that a manager could understand. The RAM is reported in the EXT_MEM field as bytes. I want to convert it to Megabytes and round the results to XXX.X, such as converting 131,805,184 bytes to read 125.7 MB. Think I need to do this conversion before I add the line about selecting only Ram less than 512.

I'm still a newbie at Crystal Reports and formula writing but learning extremely fast! Found a Tek-Tip here a few weeks past that helped me format a report. I'm still using that report as a template. Thanks for your help!
 
round({BytesField}/1048000,1) should do the trick. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
More acurately, you need

({BytesField} /1024) / 1024)
or
({BytesField} / 1048576)

Rounding will be automatic if you format the field with 1 decimal place. Although if you need to summarize the RAM on the report, you will need to consider whether dgillz rounding solution would be better. If so, use

round (( {BytesField}/1024 ) / 1024 ) , 1 )
or
round ( {BytesField}/1048576, 1 )
Steve Phillips, Crystal Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top