The 'clever' solution fails miserably on value zero and needs hard-coding to handle it. That looks like using the wrong tool.
As for the handling of zero, well, that’s not about mathematics or about how a computer stores or represents data—that’s about how humans represent data. We choose to special-case zero, allowing it to have a leading zero which we never allow for anything else. All solutions in software will need to special-case zero.