'How to display price of a menu item with 2 decimals?
Super newb. Just a few days in and trying to display the price of an item with 2 decimal points instead of as an integer. I know there are several ways to represent decimal points. I've seen short examples and wasn't sure where to use them or if they would work at all with what i've written enter image description here
format(value, '.2f')
n = 5 print(f'{n:.2f}')
b = round(a, 2) print(b)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
