diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-11-21 22:55:36 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-11-21 22:55:36 +0100 |
| commit | fe59ae44f86b20c8ad85a699ae923a67b894c124 (patch) | |
| tree | 7edd8fa75d6602876217e6c6984d109fd95c8171 | |
| parent | afb37da0535186c6909d4410efc0a20c4a88c8c9 (diff) | |
| download | PROJ-fe59ae44f86b20c8ad85a699ae923a67b894c124.tar.gz PROJ-fe59ae44f86b20c8ad85a699ae923a67b894c124.zip | |
rtodms(): make it output decimal point when locale has comma decimal instead
| -rw-r--r-- | src/rtodms.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rtodms.c b/src/rtodms.c index f0e2f675..674cebdf 100644 --- a/src/rtodms.c +++ b/src/rtodms.c @@ -66,6 +66,13 @@ rtodms(char *s, double r, int pos, int neg) { size_t suffix_len = sign ? 3 : 2; (void)sprintf(ss,format,deg,min,sec,sign); + /* Replace potential decimal comma by decimal point for non C locale */ + for( p = ss; *p != '\0'; ++p ) { + if( *p == ',' ) { + *p = '.'; + break; + } + } for (q = p = ss + strlen(ss) - suffix_len; *p == '0'; --p) ; if (*p != '.') ++p; |
