Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Regex/translate solution in Clear category for Currency Style by martin_b
def checkio(t):
# regex:
# match string starting with $, followed by 1-3 digits,
# followed by 0 or more times dot and 3digits,
# followed by 0 or once by comma and 2 digits,
# which are not followed by a digit
import re
return re.sub("\$(\d{1,3})(\.\d{3})*(,\d{2}(?!\d))?",
lambda s: s.group(0).translate(t.maketrans(',.', '.,')), t)
April 11, 2016
Comments: