www/js/bc/EAN_UPC.js
//number needs to be a string
number needs to be a string
number needs to be a string
function createEAN13(number){
		var encoder = new EANencoder();
		var result = "";
		var structure = encoder.getEANstructure(number);
		var leftSide = number.substr(1,7);
		var rightSide = number.substr(7,6);
		result += encoder.startBin;
		result += encoder.encode(leftSide, structure);
		result += encoder.middleBin;
		result += encoder.encode(rightSide,"RRRRRR");
		result += encoder.endBin;
		return result;
	}
function createEAN13 ( number ) { var encoder = new EANencoder ( ) ; var result = "" ; var structure = encoder . getEANstructure ( number ) ; var leftSide = number . substr ( 1 , 7 ) ; var rightSide = number . substr ( 7 , 6 ) ; result += encoder . startBin ; result += encoder . encode ( leftSide , structure ) ; result += encoder . middleBin ; result += encoder . encode ( rightSide , "RRRRRR" ) ; result += encoder . endBin ; return result ; }
number needs to be a string
number needs to be a string
//Create the return variable //Get the number to be encoded on the left side of the EAN code //Get the number to be encoded on the right side of the EAN code //Add the start bits //Add the left side //Add the middle bits //Add the right side //Add the end bits