Displaying the output of a variable to more than 2 decimal places

后端 未结 4 1547
半阙折子戏
半阙折子戏 2020-12-20 02:14

I\'m trying to display the output of my addition to more than 2 decimal places.

import time
import random

max_number = 1000000.0
random_time = random.randra         


        
4条回答
  •  孤城傲影
    2020-12-20 02:52

    You already have the full number. Use a custom format specifier on output.

    >>> print '%.15f' % range_key
    1347053222.790798902511597
    

提交回复
热议问题