Skip to content
UPEEC

format()

Formats a single value using the same mini-language as f-strings.

Easy
Comments 0
format(3.14159, ".2f")     # '3.14'
format(255, "08b")         # '11111111'
format(1234567, ",")       # '1,234,567'

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.