General floating point formatting functions.
Each takes a number or a string and a number of digits as arguments.
x: number to be formatted; or a string resembling a number
digits_behind: number of digits behind the decimal point
- Return (sign, intpart, fraction, expo) or raise an exception:
sign is '+' or '-'
intpart is 0 or more digits beginning with a nonzero
fraction is 0 or more digits
expo is an integer
- fix(x, digs)
- Format x as [-]ddd.ddd with 'digs' digits after the point
and at least one digit before.
If digs <= 0, the point is suppressed.
- roundfrac(intpart, fraction, digs)
- Round or extend the fraction to size digs.
- sci(x, digs)
- Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point
and exactly one digit before.
If digs is <= 0, one digit is kept and the point is suppressed.
- Interactive test run.
- unexpo(intpart, fraction, expo)
- Remove the exponent by changing intpart and fraction.
||__file__ = '/usr/lib/python1.6/fpformat.pyc'|
__name__ = 'fpformat'
decoder = <SRE_Pattern object at 850cba0>