|
-
June 22nd, 2012, 09:34 AM
#1
How can I round this Convert.ToInt64 number that will be returned
Hello,
I need to have this number rounded and have never done this before, so If you can help me that would be great.
long mem1 = Convert.ToInt64(objPartition["Size"].ToString()) / 1024 / 1024 / 1024 + 0;
Currently it is reporting 3GB and should be 4GB
So this number must be close to 3.xxxx and need to be round up to 4.xx
I found this on msdn, but dont understand how to make it work with my line of code.
Math.Round(3.44, 1); //Returns 3.4.
Math.Round(3.45, 1); //Returns 3.4.
Math.Round(3.46, 1); //Returns 3.5.
Thanks for your help,
-Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|