Clavin June Posted on Jan 17, 2021 • Originally published at clavinjune.dev on Jan 15, 2021 Python Format Specifier for Thousands Separator #notes #python #number #format I hate to say this, but I forgot this one-liner syntax in my online coding test. So, I think I need to put this here. format = lambda n: '{:,}'.format(n) print(format(-1234567890)) # -1,234,567,890 Enter fullscreen mode Exit fullscreen mode Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)