yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

python style floats: strcat -> strcpy #196

Closed yakra closed 2 years ago

yakra commented 2 years ago
sprintf(coordstr, " %.15g", lat);
if (!strchr(coordstr, '.')) strcat(coordstr, ".0");

->

int e = sprintf(coordstr, " %.15g", lat);
if (!strchr(coordstr, '.')) strcpy(coordstr+e, ".0");

Better yet?

int e = sprintf(coordstr, " %.15g", lat);
if (lat==int(lat)) strcpy(coordstr+e, ".0");
yakra commented 2 years ago

Tasks: