Commit d1fe88d2 authored by Sylvie Ye's avatar Sylvie Ye Committed by Vincent A

[sgpe] avoid float value in transfer amount

and use Decimal instead to avoid:
"353.34" => "353.34000000000003"
parent fc710cb3
......@@ -186,11 +186,11 @@ class TransferPage(LoggedPage, ErrorCheckedJsonPage):
transfer.recipient_iban = Dict('ibanCompte')(recipient_data)
transfer.currency = Dict('montantTotalOrdre/codeDevise')(transfer_data)
transfer.amount = CleanDecimal(Eval(
transfer.amount = Eval(
lambda x, y: x * (10 ** -y),
Dict('montantTotalOrdre/valeurMontant'),
Dict('montantTotalOrdre/codeDecimalisation')
))(transfer_data)
CleanDecimal(Dict('montantTotalOrdre/valeurMontant')),
CleanDecimal(Dict('montantTotalOrdre/codeDecimalisation'))
)(transfer_data)
transfer.exec_date = Date(Dict('dateExecution'), dayfirst=True)(transfer_data)
transfer.label = Dict('libelleClientOrdre')(transfer_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment