Specifying the number of decimal places sets the amount of digits to appear after the decimal in a floating point number.
Solution for How to specify the number of decimal places in Python : You can use str.format() to specify the number of decimal places Call str.format(float) with str as “{:.xf}” to get a string representation of float with x decimal places. Call float(str) to convert the previous result str to a float.