The only thing that's wrong is that you didn't account for leading zero's.
Your initial question has a type who's size is always 1 byte.
However your second question, the one where 'something is wrong' requires
more bits of information to hold the given value.
You need to modify the sprintf to pad
On Tue, Feb 4, 2020 at 01:04 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
...
> >> Who do I get it to print
>>
> >> 0b0100_
Look at my module Text::Utils and its "commify" sub taken from "The Perl
Cookbook." Its algorithm (similar to Paul's) should be able to do