Guest User

Guest User

  • Tech Writer
  • 515
  • 43.3k

about converting gigabytes to kilobytes

Nov 19 2021 11:49 AM

hello,

I want to convert gigabytes to kilobytes, i am able to do it.

for example, I can convert 1 Gb to 1048576 kb, but when I try to convert 0.1 Gb it gives 0 kb, it should give answer as 104857.6

Following code I am using : 

var da = Convert.ToDecimal(temp.DataAllowance);
            temp.DataByteAllowed = Convert.ToInt32(da) * 1024 * 1024;


Answers (1)