diff --git a/src/Faker/Provider/nl_BE/Payment.php b/src/Faker/Provider/nl_BE/Payment.php index 05fd70ed39..e825340afc 100644 --- a/src/Faker/Provider/nl_BE/Payment.php +++ b/src/Faker/Provider/nl_BE/Payment.php @@ -44,6 +44,6 @@ public static function vat($spacedNationalPrefix = true) $checksum = 97 - fmod($firstSeven, 97); // '0' + 7 numbers + checksum - return sprintf('%s0%s%s', $prefix, $firstSeven, $checksum); + return sprintf('%s0%s%02d', $prefix, $firstSeven, $checksum); } } diff --git a/test/Faker/Provider/nl_BE/PaymentTest.php b/test/Faker/Provider/nl_BE/PaymentTest.php index 988f57d396..61f6e2bfcb 100644 --- a/test/Faker/Provider/nl_BE/PaymentTest.php +++ b/test/Faker/Provider/nl_BE/PaymentTest.php @@ -33,6 +33,8 @@ private function validateChecksum($vat) // Mod97 check on first 8 digits $checksum = 97 - fmod(substr($numbers, 0, 8), 97); + // Make sure checksum is 2 characters long + $checksum = sprintf('%02d', $checksum); self::assertEquals((string) $checksum, substr($numbers, 8, 10)); }