-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The function prettify has a self-loop, but it doesn't account for a different character in the loop it just affects the first iteration.
This is the solution to the error.
def prettify(amount, separator=','): """Separate with predefined separator.""" orig = str(amount) new = re.sub("^(-?\d+)(\d{3})", "\g<1>{0}\g<2>".format(separator), str(amount)) if orig == new: return new else: return prettify(new, separator)
Metadata
Metadata
Assignees
Labels
No labels