Index: /trunk/FACT++/src/tools.cc
===================================================================
--- /trunk/FACT++/src/tools.cc	(revision 14218)
+++ /trunk/FACT++/src/tools.cc	(revision 14219)
@@ -11,4 +11,6 @@
 
 #include <stdarg.h>
+#include <iomanip>
+#include <sstream>
 
 #include <boost/tokenizer.hpp>
@@ -143,4 +145,73 @@
 }
 
+string Tools::Scientific(uint64_t val)
+{
+    ostringstream rc;
+    rc << setprecision(1) << fixed;
+
+    if (val<1000)
+    {
+        rc << val << " ";
+        return rc.str();
+    }
+
+    if (val<3000)
+    {
+        rc << val/1000. << " k";
+        return rc.str();
+    }
+
+    if (val<1000000)
+    {
+        rc << val/1000 << " k";
+        return rc.str();
+    }
+
+    if (val<3000000)
+    {
+        rc << val/1000000. << " M";
+        return rc.str();
+    }
+
+    if (val<1000000000)
+    {
+        rc << val/1000000 << " M";
+        return rc.str();
+    }
+
+    if (val<3000000000)
+    {
+        rc << val/1000000000. << " G";
+        return rc.str();
+    }
+
+    if (val<1000000000000)
+    {
+        rc << val/1000000000 << " G";
+        return rc.str();
+    }
+
+    if (val<3000000000000)
+    {
+        rc << val/1000000000000. << " T";
+        return rc.str();
+    }
+
+    if (val<1000000000000000)
+    {
+        rc << val/1000000000000 << " T";
+        return rc.str();
+    }
+
+    if (val<3000000000000000)
+    {
+        rc << val/1000000000000000. << " P";
+        return rc.str();
+    }
+
+    rc << val/1000000000000000. << " P";
+    return rc.str();
+}
+
 // --------------------------------------------------------------------------
 //
Index: /trunk/FACT++/src/tools.h
===================================================================
--- /trunk/FACT++/src/tools.h	(revision 14218)
+++ /trunk/FACT++/src/tools.h	(revision 14219)
@@ -12,4 +12,5 @@
     std::string TrimQuotes(const std::string &str);
     std::string Wrap(std::string &str, size_t width=78);
+    std::string Scientific(uint64_t val);
 
     std::map<std::string,std::string> Split(std::string &, bool = false);
