diff --git a/lib-nested-core/src/editors/integer/radix.rs b/lib-nested-core/src/editors/integer/radix.rs index 4c5cf31..36213a9 100644 --- a/lib-nested-core/src/editors/integer/radix.rs +++ b/lib-nested-core/src/editors/integer/radix.rs @@ -113,9 +113,13 @@ impl RadixProjection { if let Some(src) = self.src.as_ref() { let mut val = src.get_value(); - while val > 0 { - self.dst_digits.push(val % self.dst_radix); - val /= self.dst_radix; + if val == 0 { + self.dst_digits.push(0); + } else { + while val > 0 { + self.dst_digits.push(val % self.dst_radix); + val /= self.dst_radix; + } } }