Is it possible to combine more than one colon-format-string? Example:
val = 2.123
print(f'This is a float-value with one digit: {val:.1f} and balanced to right with {val:>10}')
so, something like {val:.1f:>10}?
CodePudding user response:
Refer to Format Specification Mini Language . You were just off with the order, f'{val:>10.1f}' works for this specific example.
> is align, 10 is width, .1 is precision and f is type.
