xls
xls copied to clipboard
trace_fmt should support printing bitfields with leading zeros
Currently if you have a variable x
that is a u8
and has value 3, printing it using trace_fmt!("{:b}",x)
will print out 11
.
It would be nice to be able to say trace_fmt!("{:0b}",x)
and get 00000011
instead.
This is particularly useful when debugging fixed point arithmetic.