70 str ftoa (double fCoord) { |
70 str ftoa (double fCoord) { |
71 // Disable the locale first so that the decimal point will not |
71 // Disable the locale first so that the decimal point will not |
72 // turn into anything weird (like commas) |
72 // turn into anything weird (like commas) |
73 setlocale (LC_NUMERIC, "C"); |
73 setlocale (LC_NUMERIC, "C"); |
74 |
74 |
75 str zRep = str::mkfmt ("%.3f", fCoord); |
75 str zRep = str::mkfmt ("%.6f", fCoord); |
76 |
76 |
77 // Remove trailing zeroes |
77 // Remove trailing zeroes |
78 while (zRep[~zRep - 1] == '0') |
78 while (zRep[~zRep - 1] == '0') |
79 zRep -= 1; |
79 zRep -= 1; |
80 |
80 |