The goal is to use an f-string to round a float to a different number of decimal places based on the size of the number.
Is there in-line f-string formatting that works like the following function?
def number_format(x: float):
if abs(x) < 10:
return f"{x:,.2f}" # thousands seperator for consistency
if abs(x) < 100:
return f"{x:,.1f}"
return f"{x:,.0f}" # this is the only one that actually needs the thousands seperator