Skip to content

Commit

Permalink
Fix math round after conversion to cents
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben committed Dec 24, 2024
1 parent a704a09 commit a538fe1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export class IntersolveVisaApiService {
reference: string;
}): Promise<void> {
const uuid = generateUUIDFromSeed(reference);
const amountInCent = amountInMajorUnit * 100;
const amountInCent = Math.round(amountInMajorUnit * 100); // Math round is needed to prevent floating point errors

const transferRequestDto: TransferRequestIntersolveApiDto = {
quantity: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@
"SUBSTITUTED";"FALSE";"CARD_CLOSED";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"FALSE";"CARD_EXPIRED";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"FALSE";"";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_OK";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_BLOCKED";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"SUSPECTED_FRAUD";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_CLOSED_DUE_TO_FRAUD";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_NO_RENEWAL";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_LOST";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_STOLEN";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_CLOSED";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"CARD_EXPIRED";"Substituted";"Card has been substituted due to re-issue";
"SUBSTITUTED";"TRUE";"";"Substituted";"Card has been substituted due to re-issue";

0 comments on commit a538fe1

Please sign in to comment.