long
variables can only hold long integers. You have to use a floating point type instead. For example:
double size = totalBlocks * blockSize / 1073741824d;
Another point to make sure is that at least one of the operands in your calculation is also a floating point type (see the d
suffix to the constant). Otherwise Java will calculate an integer value and assign it to the double variable.
Furthermore, by convention, your variables should not start with a capital letter. This style is reserved for type names.