I am reading a bytes column from the database. If I divide bytes by 1024 * 1024 I get approx. MegaBytes.
If I divide by 1024 * 1024 * 1024, I get approx. GigaBytes. However this will return 0. I am assuming this is happening because the math is applied per - row, and since this is an int field, it is rounding to 0, so the AggregateFunction.Sum is still 0.
How can I apply this expression to get the proper result?
//this works, probably because my samples have bytes greater than 1024 * 1024
fields.DefineField(new EntityField2(ReportTotalsField.TotalBytesMB.ToString(), RawLogsFields.ScBytes / (1024 * 1024), AggregateFunction.Sum), 0);
//this returns 0, is this because each value is rounding down to 0? How would this be done?
fields.DefineField(new EntityField2(ReportTotalsField.TotalBytesGB.ToString(), RawLogsFields.ScBytes / (1024 * 1024 * 1024), AggregateFunction.Sum), 4);
Thanks!