Click here to Skip to main content
15,616,520 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to convert GB to Bytes without decimal point.
e.g 3.76 GB (4,047,660,432 bytes)
But actual calculated value is 4037269258.24
Maarten Kools 5-Aug-13 6:42am    
Well, you could just use Math.Round[^]. But 4047660432 Bytes isn't exactly the same as 3.76 GB, the 3.76 is a rounded value in itself. You're never going to get the actual number of Bytes from it
Pheonyx 5-Aug-13 7:01am    
You cannot because you do not have the original value, you will only ever be able to approximately calculate the original value when your are working backwards from a rounded value.
Richard MacCutchan 5-Aug-13 9:40am    
You calculation is wrong: 4,047,660,432 is almost 3.77. Use the windows calculator to check the actual values.

1 solution

try this :

String f = Convert.ToString(Math.Round(Convert.ToDouble(3.76) * 1073741824)) + " Bytes";
Share this answer
[no name] 5-Aug-13 8:58am    
how you have calculate it to get (4,047,660,432 bytes) ??
check google calculation it give else number :,or.r_qf.&cad=b&bvm=pv.xjs.s.en_US.seW1cfrvSKg.O


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900