How do I convert a string to a floating point number if I want both comma interpreted as decimal comma and point interpreted as decimal point?
The code parses text files that have been created by our customers. They sometimes use decimal points and sometimes decimal commas but never thousand separators.
Use
std::replaceto do the hard work:If you need to cope with thousands separators it’d be much more tricky.