Class representing a percentage quantity.
The percentage is maintained internally as a string so that issues of
precision can be avoided. It really isn't possible to store a floating
point number here while being able to losslessly translate back and forth
between XML and object representations. (Perhaps the Python 2.4 Decimal
class would have been an option, but I originally wanted to stay
compatible with Python 2.3.)
Even though the quantity is maintained as a string, the string must be
in a valid floating point positive number. Technically, any floating
point string format supported by Python is allowble. However, it does
not make sense to have a negative percentage in this context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__eq__(self,
other)
Equals operator, iplemented in terms of original Python 2 compare
operator. |
source code
|
|
|
|
__lt__(self,
other)
Less-than operator, iplemented in terms of original Python 2 compare
operator. |
source code
|
|
|
|
__gt__(self,
other)
Greater-than operator, iplemented in terms of original Python 2
compare operator. |
source code
|
|
|
|
_setQuantity(self,
value)
Property target used to set the quantity The value must be a
non-empty string if it is not None. |
source code
|
|
|
|
_getQuantity(self)
Property target used to get the quantity. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__subclasshook__
|