fix-amount-conversion #87
Reference in New Issue
Block a user
Delete Branch "fix-amount-conversion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add tests of 18 d.p. to TestParseAndScaleAmount and for the menu handler itself.
Generally the following should be the behaviour:
1.85 inputted for a 18d.p token - > 1850000000000000000
1.8599999999 inputted for a 18 d.p. token -> 1850000000000000000 (we truncate anything after 2 d.p.)
2.32 inputted for a 6 d.p token -> 2320000
This has been fixed.
TruncateDecimalStringhas been added as a helper function to truncate the amounts to whichever specified d.p. This has been set to 2 in the menuhanlderParseAndScaleAmountfunc will be called after the amount has been truncated to the specified d.p.