Fix dice formatting in format-dict

parent 7f5b8140
......@@ -76,7 +76,7 @@ function format_binary(string $bin): string {
$ret = "";
/* Prefer 2d4 instead of d8d2 for 4 bits */
while(strlen($bin) > 4) {
while(strlen($bin) >= 3 && strlen($bin) !== 4) {
$ret .= (string)(bindec(substr($bin, 0, 3)) + 1);
$bin = substr($bin, 3);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment