<h1>Character encoding</h1>
<:
+use POSIX qw( ceil );
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
my $cols = 16; # columns
$title .= " <aside>($_)</aside>" for $row->{setnote} // ();
printf '<caption>%s</caption>', $title;
print '<col>' 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><tr><th>↱";
printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;