Skip to content

Commit

Permalink
Fix trailing zero when not CODE_128_C
Browse files Browse the repository at this point in the history
Fix trailing zero when not CODE_128_C
  • Loading branch information
tavinus authored Nov 20, 2018
1 parent ce97ee5 commit dce7413
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

require_once 'vendor/autoload.php';

define("_BC_VERSION", "1.0.7");
define("_BC_VERSION", "1.0.8");

# default padding for cli messages
define("_BC_PADDING", 30);
Expand Down Expand Up @@ -340,8 +340,8 @@ function vPrint($input) {
$bc_type = constant('Picqer\Barcode\BarcodeGenerator::TYPE_'.$encoding);

// add trailling zero if odd digits on Code128C
$bc_string = strlen($bc_string) % 2 == 0 && $encoding === 'CODE_128_C'?
$bc_string : '0'.$bc_string;
$bc_string = strlen($bc_string) % 2 != 0 && $encoding === 'CODE_128_C'?
'0'.$bc_string : $bc_string;

// create appropriate generator
$generator = null;
Expand Down

1 comment on commit dce7413

@tavinus
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #2

Please sign in to comment.