View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005022 | Taler | obsolete component | public | 2017-05-22 14:45 | 2018-04-15 20:34 |
Reporter | Christian Grothoff | Assigned To | Marcello Stanisci | ||
Priority | high | Severity | tweak | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Platform | i7 | OS | Debian GNU/Linux | OS Version | squeeze |
Product Version | git (master) | ||||
Target Version | 0.5 | Fixed in Version | 0.5 | ||
Summary | 0005022: amounts.py should define a class | ||||
Description | Right now, amounts in Python are simply represented as a 'dict'. It would seem cleaner to have a proper class "taler.amount" with three fields and methods to add/subtract/cmp/stringify/floatify, and constructors to parse (zero, CUR:val.frac). Also, the existing functions lack type annotations. Finally, the use of "settings.TALER_CURRENCY" should be avoided (get_zero) and instead the currency should be passed as an argument, as there may be multiple currencies used in the same application eventually, and the fundamental 'amount' abstraction should not depend on one currency being given in settings. | ||||
Tags | No tags attached. | ||||
|
such a class should never floatify any amount object: this operation does round numbers up, therefore making money disappear! |
|
This class needs tests. |
|
this feature was implemented at d0409b47b9fa from the 'copylib' repository. Manually copy the sources into any project where they are needed. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-05-22 14:45 | Christian Grothoff | New Issue | |
2017-05-22 14:45 | Christian Grothoff | Status | new => assigned |
2017-05-22 14:45 | Christian Grothoff | Assigned To | => Marcello Stanisci |
2017-05-22 14:45 | Christian Grothoff | Summary | amounts.py should probably define a class => amounts.py should define a class |
2017-10-23 10:25 | Christian Grothoff | Priority | normal => high |
2017-10-23 10:25 | Christian Grothoff | Target Version | => 0.5 |
2017-10-26 17:54 | Marcello Stanisci | Note Added: 0012515 | |
2017-10-26 18:41 | Marcello Stanisci | Note Added: 0012516 | |
2017-10-30 16:33 | Marcello Stanisci | Status | assigned => resolved |
2017-10-30 16:33 | Marcello Stanisci | Resolution | open => fixed |
2017-10-30 16:33 | Marcello Stanisci | Note Added: 0012527 | |
2017-10-31 09:10 | Christian Grothoff | Fixed in Version | => 0.5 |
2018-04-15 20:34 | Christian Grothoff | Status | resolved => closed |
2022-08-23 20:26 | Christian Grothoff | Category | bank (demonstrator) => py bank (demonstrator, obsolete) |
2023-12-03 01:23 | Christian Grothoff | Category | py bank (demonstrator, obsolete) => obsolete componet |
2023-12-11 20:08 | Florian Dold | Category | obsolete componet => obsolete component |