Andreas Piening
05/30/2022, 2:29 PMROUND
statement in some queries where I need to calculate the percentage. For example
SELECT path, type, ROUND((blocks_available * blocks_size * 10e-10), 2) AS free_gb, ROUND ((blocks_available * 1.0 / blocks * 1.0) * 100, 2) AS free_perc FROM mounts WHERE path = '/';
I expect the percentage to have two digits
after the decimal point, but instead I get values like 51.020000000000003
. Can anyone tell why this is or how I can fix this? These long numbers are hard to read for percentage values.seph
TimBo
06/09/2022, 8:46 PMselect hostname from system_info;
select address from interface_addresses;
select version from kernel_info;
sorry for the newb question