How to convert a string to float if the thousands and decimals points are the same

  floating-point, locale, python, separator, string

I would like to convert an string like ‘-2.676.15024’ and ‘2.938.45500’ to float? My data base has some examples like this, where the number(string) has thousands and decimals separators with the same symbol, in these cases a point.

Source: Python Questions

LEAVE A COMMENT