private boolean checkSeVatId ( final String pvatId ) { final int checkSum = pvatId . charAt ( 11 ) - ' ' ; final int sum = squareSum ( ( pvatId . charAt ( 2 ) - ' ' ) * 2 ) + pvatId . charAt ( 3 ) - ' ' + squareSum ( ( pvatId . charAt ( 4 ) - ' ' ) * 2 ) + pvatId . charAt ( 5 ) - ' ' + squareSum ( ( pvatId . charAt ( 6 ) - ' ' ) * 2 ) + pvatId . charAt ( 7 ) - ' ' + squareSum ( ( pvatId . charAt ( 8 ) - ' ' ) * 2 ) + pvatId . charAt ( 9 ) - ' ' + squareSum ( ( pvatId . charAt ( 10 ) - ' ' ) * 2 ) ; int calculatedCheckSum = 10 - sum % 10 ; if ( calculatedCheckSum == 10 ) { calculatedCheckSum = 0 ; } return checkSum == calculatedCheckSum ; }
check the VAT identification number country version for Sweden .