Use milo dtoa for consistent string representation of numbers

This commit is contained in:
Eric Fischer
2017-08-29 14:44:34 -07:00
parent 3840176d5c
commit f9a007e8c3
32 changed files with 107 additions and 95 deletions
+3 -2
View File
@@ -7,6 +7,7 @@
#include "geometry.hpp"
#include "mvt.hpp"
#include "write_json.hpp"
#include "milo/dtoa_milo.h"
struct lonlat {
int op;
@@ -120,7 +121,7 @@ void layer_to_geojson(FILE *fp, mvt_layer const &layer, unsigned z, unsigned x,
if (v == (long long) v) {
fprintf(fp, ": %lld", (long long) v);
} else {
fprintf(fp, ": %g", v);
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
}
} else if (val.type == mvt_float) {
fprintq(fp, key);
@@ -128,7 +129,7 @@ void layer_to_geojson(FILE *fp, mvt_layer const &layer, unsigned z, unsigned x,
if (v == (long long) v) {
fprintf(fp, ": %lld", (long long) v);
} else {
fprintf(fp, ": %g", v);
fprintf(fp, ": %s", milo::dtoa_milo(v).c_str());
}
} else if (val.type == mvt_sint) {
fprintq(fp, key);