X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/eea96a232c342a6e73c9a8acdc8ee9e8218fe2ae..2337f25b4499555c4ad9755c91c2b930172a35e4:/charset.plp
diff --git a/charset.plp b/charset.plp
index 080e208..1186585 100644
--- a/charset.plp
+++ b/charset.plp
@@ -19,6 +19,7 @@ Html({
Character encoding
<:
+use POSIX qw( ceil );
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
my $cols = 16; # columns
@@ -162,7 +163,7 @@ for my $row (@request) {
$title .= " " for $row->{setnote} // ();
printf '%s', $title;
print '' x ($cols + 1);
- my $coldigits = $colsize * $cols <= 16 ? 1 : 2; # uniform length of hexadecimal header
+ my $coldigits = ceil(log($colsize * $cols) / log(16)); # uniform length of hexadecimal header
for my $section (qw{thead}) {
print "<$section>â±";
printf ' | %0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
|
---|