13
What is this format specifier?
(lemm.ee)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
%.2f
will format your number rounded to two decimal places. So if you had 1 / 3 it would come out as 0.33 instead of 0.333333% is the placeholder for the value
.2 tells it 'two spaces after the decimal'
f tells it that the placeholder is a float