I want to format binary numbers by grouping them into blocks of four and adding leading zeros to fill 8, 16 or 32 bit numbers. E.g: 11001 -> 0001 1001.
I've already found the siunitx package, which makes number formatting possible, but it doesn't work as expected.
\num[group-four-digits=true]{00011001}gives0001 1001(as expected)\num[minimum-integer-digits=8]{11001}gives00 001 001(as expected)\num[group-four-digits=true,minimum-integer-digits=8]{1001}gives00 001 001(thegroup-four-digitsoption is ignored).
How can I make siunitx use the group-four-digits switch in combination with minimum-integer-digits? Or is there a better way to format binary numbers in LaTeX? Thanks in advance.
siunitxdo you use? The reason I ask is that I'm not able to reproduce your stated results for items 1 and 3 with the most up-to-date version of the package, which isv2.6s(2016/09/02). – Mico Sep 25 '16 at 00:06group-four-digitsoption stands for? For sure, it does not group long strings of digits into "blocks of four". If grouping is performed, it's always in blocks of three, not four. Usually, such grouping is performed only if the number contains at least 5 digits; thegroup-four-digitsinstructssiunitxto apply this grouping to 4-digit numbers as well. – Mico Sep 25 '16 at 00:06