|
GnuCash fec5643+
|
Public Member Functions | |
| __init__ (self, *args, **kargs) | |
| __setattr__ (self, name, value) | |
| __lt__ (a, b) | |
| __gt__ (a, b) | |
| __le__ (a, b) | |
| __ge__ (a, b) | |
| __eq__ (a, b) | |
| __bool__ (a) | |
| __float__ (self) | |
| __int__ (self) | |
| __pos__ (a) | |
| __neg__ (a) | |
| __abs__ (a) | |
| to_fraction (self) | |
| __str__ (self) | |
Public Member Functions inherited from python.gnucash_core.GnuCashCoreClass | |
| do_lookup_create_oo_instance (self, lookup_function, cls, *args) | |
Data Fields | |
| instance | |
Protected Member Functions | |
| _operator_fallbacks (monomorphic_operator, fallback_operator) | |
| _add (a, b) | |
| _sub (a, b) | |
| _mul (a, b) | |
| _div (a, b) | |
| _floordiv (a, b) | |
| _lt (a, b) | |
| _gt (a, b) | |
| _le (a, b) | |
| _ge (a, b) | |
| _eq (a, b) | |
| _richcmp (self, other, op) | |
Additional Inherited Members | |
Static Protected Attributes inherited from python.gnucash_core.GnuCashCoreClass | |
| _module = gnucash_core_c | |
Object used by GnuCash to store all numbers. Always consists of a numerator and denominator. The constants GNC_DENOM_AUTO, GNC_HOW_RND_FLOOR, GNC_HOW_RND_CEIL, GNC_HOW_RND_TRUNC, GNC_HOW_RND_PROMOTE, GNC_HOW_RND_ROUND_HALF_DOWN, GNC_HOW_RND_ROUND_HALF_UP, GNC_HOW_RND_ROUND, GNC_HOW_RND_NEVER, GNC_HOW_DENOM_EXACT, GNC_HOW_DENOM_REDUCE, GNC_HOW_DENOM_LCD, and GNC_HOW_DENOM_FIXED are available for arithmetic functions like GncNumeric.add Look at gnc-numeric.h to see how to use these
Definition at line 537 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__init__ | ( | self, | |
| * | args, | ||
| ** | kargs | ||
| ) |
Constructor that supports the following formats:
* No arguments defaulting to zero: eg. GncNumeric() == 0/1
* A integer: e.g. GncNumeric(1) == 1/1
* Numerator and denominator intager pair: eg. GncNumeric(1, 2) == 1/2
* A floating point number: e.g. GncNumeric(0.5) == 1/2
* A floating point number with defined conversion: e.g.
GncNumeric(0.5, GNC_DENOM_AUTO,
GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER) == 1/2
* A string: e.g. GncNumeric("1/2") == 1/2
Definition at line 552 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__abs__ | ( | a | ) |
abs(a)
Definition at line 734 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__bool__ | ( | a | ) |
a != 0
Definition at line 716 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__eq__ | ( | a, | |
| b | |||
| ) |
a == b
Definition at line 712 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__float__ | ( | self | ) |
Definition at line 720 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__ge__ | ( | a, | |
| b | |||
| ) |
a >= b
Definition at line 708 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__gt__ | ( | a, | |
| b | |||
| ) |
a > b
Definition at line 700 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__int__ | ( | self | ) |
Definition at line 723 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__le__ | ( | a, | |
| b | |||
| ) |
a <= b
Definition at line 704 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__lt__ | ( | a, | |
| b | |||
| ) |
a < b
Definition at line 696 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__neg__ | ( | a | ) |
-a
Definition at line 730 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__pos__ | ( | a | ) |
+a
Definition at line 726 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__setattr__ | ( | self, | |
| name, | |||
| value | |||
| ) |
Definition at line 567 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.__str__ | ( | self | ) |
Returns a human readable numeric value string as UTF8.
Definition at line 742 of file gnucash_core.py.
|
protected |
Definition at line 637 of file gnucash_core.py.
|
protected |
Definition at line 646 of file gnucash_core.py.
|
protected |
Definition at line 676 of file gnucash_core.py.
|
protected |
Definition at line 649 of file gnucash_core.py.
|
protected |
Definition at line 673 of file gnucash_core.py.
|
protected |
Definition at line 667 of file gnucash_core.py.
|
protected |
Definition at line 670 of file gnucash_core.py.
|
protected |
Definition at line 664 of file gnucash_core.py.
|
protected |
Definition at line 643 of file gnucash_core.py.
|
protected |
fallbacks are not needed except for method name, keep for possible later use
Definition at line 614 of file gnucash_core.py.
|
protected |
Helper for comparison operators, for internal use only. Implement comparison between a GncNumeric instance `self`, and either another GncNumeric instance, an int or a float `other`. If `other` is not an instance of that kind, return NotImplemented. `op` should be one of the six standard comparison operators. The comparisons are based on GncNumeric.compare().
Definition at line 679 of file gnucash_core.py.
|
protected |
Definition at line 640 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.to_fraction | ( | self | ) |
Definition at line 738 of file gnucash_core.py.
| python.gnucash_core.GncNumeric.instance |
Definition at line 744 of file gnucash_core.py.