Welcome to Code Sharer, a code gallery for creating, saving and sharing all kinds of code snippets.

Snips Tagged "rounding" 1 result found

A simple rounding function for Python 3 Python 123
Author: Ryan Bradley-Evans (Admin) Posted On: Thursday, September 6, 2018 at 11:44 AM

There are no library dependencies for this to work.


The syntax can easily be changed to work with Python 2.


To use, include the code after your imports section of your program then type round(x) where you want a number to be rounded. replace x with the float you want to be properly rounded.