[mythtv-commits] Ticket #3957: Missing comma in disk space sizes greater than 1000 MB
MythTV
mythtv at cvs.mythtv.org
Thu Sep 13 23:51:43 UTC 2007
#3957: Missing comma in disk space sizes greater than 1000 MB
-----------------------+----------------------------------------------------
Reporter: anonymous | Owner: ijr
Type: defect | Status: new
Priority: trivial | Milestone: unknown
Component: mythtv | Version: head
Severity: low | Resolution:
Mlocked: 0 |
-----------------------+----------------------------------------------------
Comment(by anonymous):
Thanks for the patch, Joe.
[[BR]]
1) Here is an even simpler one:
Index: httpstatus.cpp
===================================================================
--- httpstatus.cpp (revision 14490)
+++ httpstatus.cpp (working copy)
@@ -21,6 +21,7 @@
#include <qfile.h>
#include <qregexp.h>
#include <qbuffer.h>
+#include <qlocale.h>
#include <math.h>
#include "../../config.h"
@@ -1132,16 +1133,17 @@
os << nDirs << "</li>\r\n";
}
+ QLocale c(QLocale::C);
os << " <li>Total Space: ";
- sRep.sprintf( "%d,%03d MB ", (nTotal) / 1000, (nTotal) %
1000);
+ sRep = c.toString(nTotal) + " MB ";
os << sRep << "</li>\r\n";
os << " <li>Space Used: ";
- sRep.sprintf( "%d,%03d MB ", (nUsed) / 1000, (nUsed) %
1000);
+ sRep = c.toString(nUsed) + " MB ";
os << sRep << "</li>\r\n";
os << " <li>Space Free: ";
- sRep.sprintf( "%d,%03d MB ", (nFree) / 1000, (nFree) %
1000);
+ sRep = c.toString(nFree) + " MB ";
os << sRep << "</li>\r\n";
os << " </ul>\r\n"
}}}
2) I suspect we shouldn't be anchoring this in MB. It won't be long before
most users have Terabytes, and I think a signed long long can represent
1.3 Petabytes. Maybe a generic SI prefix routine?
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/3957#comment:4>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list