如何表示一个多位整数?例如将1表示为01
我如何 NSLog/Output 到一个整数标签,例如 7 作为 07 而不仅仅是 7?
我尝试过 %ii 和 %2i 但没有成功,并在 Google 上搜索了解决方案!
当然有办法做到这一点!
有人吗?谢谢。
How could I NSLog/Output to a label an integer such as 7 as 07 rather than just 7?
I've tried %ii and %2i without success, and searched all over Google for a solution!
Surely there's a way to do it!?
Anyone? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
NSLog/printf 格式允许
%02d
。NSLog/printf format allows
%02d
.只要使用
它就会输出:07
Just use
It will output: 07