]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Dynamically sort the millisecond columns
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Nov 2010 11:30:28 +0000 (11:30 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Nov 2010 11:30:28 +0000 (11:30 +0000)
The time columns containing the millisecond could not be sorted
properly if formatted with a dot as the separator.

Thanks to igora100 for pointing out the problem.

html.c
topuser.c

diff --git a/html.c b/html.c
index 1ee57510577ad72639e8316df33a1a7fc1d14edf..6f6e5ee0defa6c188cbde6d16de2c6f60cac6a91 100644 (file)
--- a/html.c
+++ b/html.c
@@ -356,8 +356,11 @@ void htmlrel(void)
                if (SortTableJs[0]) fprintf(fp_ou," sorttable_customkey=\"%"PRId64"\"",(int64_t)nnelap);
                fprintf(fp_ou,">%s</td>",buildtime(nnelap));
             }
-            if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0)
-               fprintf(fp_ou,"<td class=\"data\">%s</td>",fixnum2(nnelap,1));
+            if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0) {
+               fputs("<td class=\"data\"",fp_ou);
+               if (SortTableJs[0]) fprintf(fp_ou," sorttable_customkey=\"%"PRId64"\"",(int64_t)nnelap);
+               fprintf(fp_ou,">%s</td>",fixnum2(nnelap,1));
+            }
             if((UserReportFields & USERREPORTFIELDS_PTIME) != 0) {
                perc2=(tnelap) ? nnelap * 100. / tnelap : 0.;
                fprintf(fp_ou,"<td class=\"data\">%3.2lf%%</td>",perc2);
index 2ecb87c253f9e4d192cf8cac00314ffde2e16c45..9d269560f0531e5fc966da311a6844038742b2bd 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -341,8 +341,11 @@ void topuser(void)
          if (SortTableJs[0]) fprintf(fp_top3," sorttable_customkey=\"%"PRId64"\"",(int64_t)tnelap);
          fprintf(fp_top3,">%s</td>",buildtime(tnelap));
       }
-      if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
-         fprintf(fp_top3,"<td class=\"data\">%s</td>",fixnum2(tnelap,1));
+      if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0) {
+         fputs("<td class=\"data\"",fp_top3);
+         if (SortTableJs[0]) fprintf(fp_top3," sorttable_customkey=\"%"PRId64"\"",(int64_t)tnelap);
+         fprintf(fp_top3,">%s</td>",fixnum2(tnelap,1));
+      }
       if((TopUserFields & TOPUSERFIELDS_PTIME) != 0) {
          perc2=(ttnelap) ? elap * 100. / ttnelap : 0.;
          fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td>",perc2);