diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-10 17:20:49 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-10 17:20:49 -0400 |
commit | 73769dcb8667b855b95d183322214331b0c11dd0 (patch) | |
tree | 6ae090d0a8f47ad4a4e361d9388cea2bdb174263 /tools.py | |
parent | e19f8046b479790a9b5f8feedf8a13678f75d350 (diff) | |
download | chroma-73769dcb8667b855b95d183322214331b0c11dd0.tar.gz chroma-73769dcb8667b855b95d183322214331b0c11dd0.tar.bz2 chroma-73769dcb8667b855b95d183322214331b0c11dd0.zip |
round value and uncertainty in ufloat_to_str().
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -6,7 +6,8 @@ import math def ufloat_to_str(x): msd = -int(math.floor(math.log10(x.std_dev()))) - return '%.*f +/- %.*f' % (msd, x.nominal_value, msd, x.std_dev()) + return '%.*f +/- %.*f' % (msd, round(x.nominal_value, msd), + msd, round(x.std_dev(), msd)) def progress(seq): "Print progress while iterating over `seq`." |