xls icon indicating copy to clipboard operation
xls copied to clipboard

trace_fmt should support printing bitfields with leading zeros

Open sandwichmaker opened this issue 2 years ago • 0 comments

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.

sandwichmaker avatar Jul 07 '22 23:07 sandwichmaker