From: Frédéric Marchal Date: Fri, 26 Nov 2010 11:30:28 +0000 (+0000) Subject: Dynamically sort the millisecond columns X-Git-Tag: v2.3.2~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32b1f88e194a7ac657b583ea1dc30abfb1436fb7;p=thirdparty%2Fsarg.git Dynamically sort the millisecond columns 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. --- diff --git a/html.c b/html.c index 1ee5751..6f6e5ee 100644 --- 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",buildtime(nnelap)); } - if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0) - fprintf(fp_ou,"%s",fixnum2(nnelap,1)); + if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0) { + fputs("%s",fixnum2(nnelap,1)); + } if((UserReportFields & USERREPORTFIELDS_PTIME) != 0) { perc2=(tnelap) ? nnelap * 100. / tnelap : 0.; fprintf(fp_ou,"%3.2lf%%",perc2); diff --git a/topuser.c b/topuser.c index 2ecb87c..9d26956 100644 --- 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",buildtime(tnelap)); } - if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0) - fprintf(fp_top3,"%s",fixnum2(tnelap,1)); + if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0) { + fputs("%s",fixnum2(tnelap,1)); + } if((TopUserFields & TOPUSERFIELDS_PTIME) != 0) { perc2=(ttnelap) ? elap * 100. / ttnelap : 0.; fprintf(fp_top3,"%3.2lf%%",perc2);