Skip to content

Commit

Permalink
chore: Refactor to compare numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonBalthazar committed Jun 3, 2024
1 parent 0e53e14 commit 1c5df67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/fr/tva.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ const impl: Validator = {
if (strings.isdigits(check)) {
const sum = (12 + 3 * (parseInt(back, 10) % 97)) % 97;

const stringSum = String(sum).padStart(2, '0');
if (stringSum !== check) {
if (sum !== parseInt(check, 10)) {
return { isValid: false, error: new exceptions.InvalidChecksum() };
}
} else {
Expand Down

0 comments on commit 1c5df67

Please sign in to comment.