I have an inventory script I have put together which pulls the hard drive freespace and total space from WMI. The retrieved sizes are represented in bytes but I want them to be displayed as Gigs in my log files.

I have tried dividing the variable for these sizes but always get an error in expression.

For example:
$DiskSet = GetObject($WMI).ExecQuery("SELECT * FROM WIN32_LOGICALDISK WHERE DriveType=3")

For Each $Disk in $DiskSet
$FreeSpace = $Disk.FreeSpace
$TotalSpace = $Disk.Size
Next

$sizeingigs =$totalspace / 1,073,741,824
? $sizeingigs

This doesnt work and Im sure theres a simple explanation. Also if this would work or once I get something to work, what would be the easiest way to round the product from xx.xxxxxx to xx.x?
I'm relatively new to scripting so be kind.
thanks