View Issue Details

IDProjectCategoryView StatusLast Update
0005022Talerpy bank (demonstrator, obsolete)public2018-04-15 20:34
ReporterChristian Grothoff Assigned ToMarcello Stanisci  
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.5Fixed in Version0.5 
Summary0005022: should define a class
DescriptionRight 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.
TagsNo tags attached.


Marcello Stanisci

2017-10-26 17:54

viewer   ~0012515

such a class should never floatify any amount object: this operation does round numbers up, therefore making money disappear!

Marcello Stanisci

2017-10-26 18:41

viewer   ~0012516

This class needs tests.

Marcello Stanisci

2017-10-30 16:33

viewer   ~0012527

this feature was implemented at d0409b47b9fa from the 'copylib' repository. Manually copy the sources into any project where they are needed.

Issue History

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 should probably define a class => 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)