Feb-19-2022, 07:57 AM
(This post was last modified: Feb-19-2022, 07:57 AM by Gribouillis.)
You could use
str.translate()
>>> s = "100.123.654,90" >>> s.translate({ord('.'): ',', ord(','): '.'}) '100,123,654.90'or
>>> table = {ord('.'): '', ord(','): '.'} >>> s = "100.123.654,90" >>> s.translate(table) '100123654.90'