View | Details | Raw Unified | Return to bug 5681
Collapse All | Expand All

(-)a/C4/Barcodes.pm (-7 / +3 lines)
Lines 135-148 sub next_value ($;$) { Link Here
135
		# Note, this enlargement might be undesireable for some barcode formats.
135
		# Note, this enlargement might be undesireable for some barcode formats.
136
		# Those should override next_value() to work accordingly.
136
		# Those should override next_value() to work accordingly.
137
	$incr++;
137
	$incr++;
138
	my $width = $self->width || undef;
138
139
	# we would want to use %$x.$xd, but that would break on large values, like 2160700004168
139
	$debug and warn "$incr";
140
	# so we let the object tell us if it has a width to focus on.  If not, we use float.
141
	my $format = ($width ? '%'."$width.$width".'d' : '%.0f');
142
	$debug and warn "sprintf(\"$format\",$incr)";
143
	$head = $self->process_head($head,$max,$specific);
140
	$head = $self->process_head($head,$max,$specific);
144
	$tail = $self->process_tail($tail,$max,$specific);
141
	$tail = $self->process_tail($tail,$max,$specific);
145
	my $next_value = $head . sprintf($format,$incr) . $tail;
142
	my $next_value = $head . $incr . $tail;
146
	$debug and print STDERR "(  next ) max barcode found: $next_value\n";
143
	$debug and print STDERR "(  next ) max barcode found: $next_value\n";
147
	return $next_value;
144
	return $next_value;
148
}
145
}
149
- 

Return to bug 5681