]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/strutl.cc
[apt-pkg/contrib/strutl.cc] enable thousand separator according to
[apt.git] / apt-pkg / contrib / strutl.cc
index 0b1bc3c98d6667fa54f437a85589bf31a3a9d918..1683868c8a398c72fb9a0e61d97233d3ac0fa56c 100644 (file)
@@ -304,13 +304,13 @@ string SizeToStr(double Size)
    {
       if (ASize < 100 && I != 0)
       {
-         sprintf(S,"%.1f%c",ASize,Ext[I]);
+         sprintf(S,"%'.1f%c",ASize,Ext[I]);
         break;
       }
       
       if (ASize < 10000)
       {
-         sprintf(S,"%.0f%c",ASize,Ext[I]);
+         sprintf(S,"%'.0f%c",ASize,Ext[I]);
         break;
       }
       ASize /= 1000.0;
@@ -387,6 +387,17 @@ string SubstVar(string Str,const struct SubstVar *Vars)
    return Str;
 }
                                                                        /*}}}*/
+// OutputInDepth - return a string with separator multiplied with depth /*{{{*/
+// ---------------------------------------------------------------------
+/* Returns a string with the supplied separator depth + 1 times in it */
+std::string OutputInDepth(const unsigned long Depth, const char* Separator)
+{
+   std::string output = "";
+   for(unsigned long d=Depth+1; d > 0; d--)
+      output.append(Separator);
+   return output;
+}
+                                                                       /*}}}*/
 // URItoFileName - Convert the uri into a unique file name             /*{{{*/
 // ---------------------------------------------------------------------
 /* This converts a URI into a safe filename. It quotes all unsafe characters