ae1db8bd101ae572e4382748dc4b19b176449fa0
chmalee
  Thu Apr 23 09:22:05 2026 -0700
Fix hubSpace quota calculation to use quotax(1024x1024x1024) rather than quotax10^9, refs #37425

diff --git src/hg/lib/hubSpaceQuotas.c src/hg/lib/hubSpaceQuotas.c
index d58ec473829..e7063e131eb 100644
--- src/hg/lib/hubSpaceQuotas.c
+++ src/hg/lib/hubSpaceQuotas.c
@@ -174,20 +174,21 @@
 fputc(':',f);
 fprintf(f, "%lld", el->quota);
 fputc('}',f);
 }
 
 /* -------------------------------- End autoSql Generated Code -------------------------------- */
 
 long long quotaForUserName(char *userName)
 /* Return the quota for a given userName or 0 if not found */
 {
 long long ret = 0;
 if (userName)
     {
     struct sqlConnection *conn = hConnectCentral();
     struct dyString *query = sqlDyStringCreate("select quota from hubSpaceQuotas where userName='%s'", userName);
-    // the mysql value is a number of gigabytes so shift it over
-    ret = sqlQuickLongLong(conn, dyStringCannibalize(&query)) * 1000000000;
+    // the mysql value is a number of gigabytes (GiB); convert to bytes so it matches
+    // the binary units used by sprintWithGreekByte / the JS prettyFileSize
+    ret = sqlQuickLongLong(conn, dyStringCannibalize(&query)) * 1024LL * 1024 * 1024;
     }
 return ret;
 }