Locale-independent “atof”?

后端 未结 8 1825
余生分开走
余生分开走 2020-12-14 17:21

I\'m parsing GPS status entries in fixed NMEA sentences, where fraction part of geographical minutes comes always after period. However, on systems where locale defines comm

8条回答
  •  北海茫月
    2020-12-14 18:04

    You could iterate through all the characters in the array and swap any non-numbers with a . character, which should work as long as the coordinates are in a number-single_delimiter_character_-number format.

提交回复
热议问题