From cb3436b42eecdb0a058ed565709804292b80469b Mon Sep 17 00:00:00 2001 From: Gehad Date: Sat, 5 Apr 2014 13:01:34 -0700 Subject: Use helper function to write decimal numbers Never ever use '%f' to write floating point data to a file. The stupid locale handling creates useless comma-infested output in some locales. Instead use one of our clever helper functions to do the right thing. Original patch by Gehad, modified by Linus to be a little more generic. Signed-off-by: Gehad elrobey Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- worldmap-save.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'worldmap-save.c') diff --git a/worldmap-save.c b/worldmap-save.c index 0c40bc30f..36ee94311 100644 --- a/worldmap-save.c +++ b/worldmap-save.c @@ -94,8 +94,8 @@ void writeMarkers(struct membuffer *b) if (dive->latitude.udeg == 0 && dive->longitude.udeg == 0) continue; - put_format(b, "temp = new google.maps.Marker({position: new google.maps.LatLng(%f,%f)});\n", - dive->latitude.udeg / 1000000.0, dive->longitude.udeg / 1000000.0); + put_degrees(b, dive->latitude, "temp = new google.maps.Marker({position: new google.maps.LatLng(", ""); + put_degrees(b, dive->longitude, ",", ")});\n"); put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '
'+'
'+'
'+'
"); put_HTML_date(b, dive); put_duration(b, dive->duration, "

duration=", " min

"); -- cgit v1.2.3-70-g09d2