Closed Virsacer closed 1 year ago
Hi @Virsacer,
I'm unable to reproduce this. Does it happen for all objects, just for specific ones, if the latter: do they have something in common?
Thanks, Thomas
Well, the servers with "0 TiB" have between 1000 and 1023 GiB memory. But I have 2 Servers which seem to have exactly 1024 GiB and they show as "1 TiB" in german.
This helped, please give the following patch a try:
--- a/library/Vspheredb/Format.php
+++ b/library/Vspheredb/Format.php
@@ -22,6 +22,7 @@ class Format
// Problem: %.3G is 0.978 for $value = 1001 / 1024, but we want to see 0.98
$output = sprintf('%.3G', $result);
if (preg_match('/^0[,.]/', $output)) {
+ $output = str_replace(',', '.', $output);
$output = sprintf('%.3G', round((float) $output, 2));
}
Yes, that fixed it. Now it shows "1 TiB" Thanks!
Expected Behavior
Same capacity for all languages And capacity > 0
Current Behavior
But also happens for non-translated languages like spanish:
Your Environment