Skip to content

Commit

Permalink
prevent invalid UPC-A entry when converting to UPC-E
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Jun 16, 2024
1 parent be78b64 commit 2f2c436
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private String convertUPCAToUPCE() {

int numericProductCode = Integer.parseInt(productCode);

if (manufacturer.endsWith("000") || manufacturer.endsWith("100") || manufacturer.endsWith("200") && numericProductCode <= 999) {
if ((manufacturer.endsWith("000") || manufacturer.endsWith("100") || manufacturer.endsWith("200")) && numericProductCode <= 999) {
//rule 1
UPCECode += manufacturer.substring(0, 2); //first two of manufacturer
UPCECode += productCode.substring(2, 5); //last three of product
Expand Down

0 comments on commit 2f2c436

Please sign in to comment.