Scott Piehn wrote:
> I Apologize for my lack of knowledge on programming.
> Following is what I have.  Displays on a single line
> 
> BytesRF, $WLANBytesR >= 1024*1024*1024 ? sprintf("%.2f GB", $WLANBytesR
> / 1024*1024*1024) :
> $WLANBytesR >= 1024*1024 ? sprintf("%.2f MB", $WLANBytesR / 1024*1024) :
> $WLANBytesR >= 1024 ? sprintf("%.2f KB", $WLANBytesR / 1024) :
> sprintf("%d B", $WLANBytesR), CALCULATION, ""
> 
> 
> If correctly gives the KB, MB, GB base on size of WLANBytesR, but
> doesn't actually do the calculation. ex
> Origional Value          = 77862289    (of WLANBytesR)
> Displayed with above = 77862289.00 MB    (is BytesRF)
> Would like                 = 74.26 MB
> Can someone point of what I am missing to get it to do the math
> 

I think you need parens around 1024*1024*1024 and 1024*1024 when dividing:

BytesRF, $WLANBytesR >= 1024*1024*1024 ? sprintf("%.2f GB", $WLANBytesR
/ (1024*1024*1024)) : $WLANBytesR >= 1024*1024 ? sprintf("%.2f MB",
$WLANBytesR / (1024*1024)) : $WLANBytesR >= 1024 ? sprintf("%.2f KB",
$WLANBytesR / 1024) : sprintf("%d B", $WLANBytesR), CALCULATION, ""

-- Christopher

-- 
=================================
Christopher L. Sweeney
Director of Software Development
Dartware, LLC
+1 603 643-9600 x104
http://dartware.com/
____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]

Reply via email to