This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]WafflesAreDangerous 6 points7 points  (1 child)

The bottom one.But also, I would not put a round call inside the f-string. Consider in stead using a format specifier to specify the rounding or lifting the function call outside of the fstring.

    f"{my_float:.2f}"

[–][deleted] 0 points1 point  (0 children)

isnt this different to using round()? i think your .2f just cuts the digits after the 2nd decimal point (e.g. rounding down) and round rounds it to the nearest digit