Increase precision of timestamps
authorSam Moore <[email protected]>
Sat, 19 Oct 2013 07:30:11 +0000 (15:30 +0800)
committerSam Moore <[email protected]>
Sat, 19 Oct 2013 07:30:11 +0000 (15:30 +0800)
Since we have nanosecond resolution. Theoretically.

server/data.c
server/fastcgi.c

index dae3172..edfd4c3 100644 (file)
@@ -161,13 +161,13 @@ void Data_PrintByIndexes(DataFile * df, int start_index, int end_index, DataForm
        switch (format)
        {
                case JSON:
-                       fmt_string = "[%f,%f]";
+                       fmt_string = "[%.9f,%f]";
                        separator = ',';
                        // For JSON we need an opening bracket
                        FCGI_PrintRaw("["); 
                        break;
                case TSV:
-                       fmt_string = "%f\t%f";
+                       fmt_string = "%.9f\t%f";
                        separator = '\n';
                        break;
        }
index d88dc20..a94a5ba 100644 (file)
@@ -370,7 +370,7 @@ void FCGI_JSONLong(const char *key, long value)
  */
 void FCGI_JSONDouble(const char *key, double value)
 {
-       printf(",\r\n\t\"%s\" : %f", key, value);
+       printf(",\r\n\t\"%s\" : %.9f", key, value);
 }
 
 /**

UCC git Repository :: git.ucc.asn.au