Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from decimal import Decimal
- # First we take a float and convert it to a decimal
- x = Decimal(16.0/7)
- print(x)
- # Then we round it to 2 places
- output = round(x,4)
- print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement