Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A library of functions that help present numerical data in a specified format

Project description

Module: Sigfig v0.1
Developed by: Michael Busuttil, Travis Valdez
Last Updated: Friday, January 10, 2014

Usage:

roundit(number, unc, **kwds):
*Possible Keywords:
a) "form = ____"
i) "SI" **default** : numbertosigfigs(uncertainty)
ii) "plusminus": numbertosigfigs +/- uncertainty
iii) "tuple": [numbertosigfigs,uncertainty]
b) crop: specifies the number under which the uncertainty is
rounded to two significant figures, and over which the uncer-
tainty is rounded to one significant figure.
- NOTE: DEFAULT IS 0

- Used to round an uncertainty (unc) to the proper crop value, round
the number (number) to match the uncertainty, and return the number
and the uncertainty in the proper form
- NOTE: THIS FUNCTION IS PERFORMED ONLY IF THE UNCERTAINTY
VALUE IS NOT AN INTEGER. IF THE UNCERTAINTY IS AN INTEGER
VALUE, ENTER IT AS A STRING (Ex. 1 --> '1')
- Used to round a number (number) to a specified amount of significant
figures (unc)
- NOTE: THIS FUNCTION IS PERFORMED ONLY IF THE UNCERTAINTY
VALUE IS AN INTEGER

*Examples:
>>> roundit(1234,1)
**WARNING:: INTEGER UNCERTAINTY VALUE --> ROUNDED TO**
**1 SIGNIFICANT FIGURE(S)**
'1 000'

>>> roundit(1234,'1')
'1 234(1)'

>>> roundit(1.234567,0.0001234)
'1.234 6(1)'

>>> roundit(1.234567,0.0001234,crop=30)
'1.234 57(12)'

>>> roundit(1.234567,0.0001234,crop=30,form="plusminus")
'1.234 57 +/- 0.00012'

>>> roundit(1.234567,0.0001234,crop=30,form="tuple")
['1.234 57', '0.00012']

PLEASE DIRECT ANY COMMENTS/SUGGESTIONS/BUGS TO: drake@pcxftw.com. THANK YOU FOR DOWNLOADING!

Project details


Release history Release notifications

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sigfig, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size sigfig-0.1.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page