View Issue Details

IDProjectCategoryView StatusLast Update
0005022Talerobsolete componentpublic2018-04-15 18:34
ReporterChristian Grothoff Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityhighSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.5Fixed in Version0.5 
Summary0005022: amounts.py 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.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Marcello Stanisci

2017-10-26 15:54

reporter   ~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 16:41

reporter   ~0012516

This class needs tests.

Marcello Stanisci

2017-10-30 15:33

reporter   ~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 ModifiedUsernameFieldChange
2017-05-22 12:45Christian GrothoffNew Issue
2017-05-22 12:45Christian GrothoffStatusnew => assigned
2017-05-22 12:45Christian GrothoffAssigned To => Marcello Stanisci
2017-05-22 12:45Christian GrothoffSummaryamounts.py should probably define a class => amounts.py should define a class
2017-10-23 08:25Christian GrothoffPrioritynormal => high
2017-10-23 08:25Christian GrothoffTarget Version => 0.5
2017-10-26 15:54Marcello StanisciNote Added: 0012515
2017-10-26 16:41Marcello StanisciNote Added: 0012516
2017-10-30 15:33Marcello StanisciStatusassigned => informing
2017-10-30 15:33Marcello StanisciResolutionopen => fixed
2017-10-30 15:33Marcello StanisciNote Added: 0012527
2017-10-31 08:10Christian GrothoffFixed in Version => 0.5
2018-04-15 18:34Christian GrothoffStatusinforming => closed
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component