我怎样才能在任何数字前面得到0? [英] How can i get 0 in front of any number?

查看:14
本文介绍了我怎样才能在任何数字前面得到0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果是个位数,我想在数字前附加 0.例如应该是 01,02,03... 09, 10, 11, ...

I would like to append 0 before a number if it is single digit. For example it should be 01,02,03... 09, 10, 11, ...

推荐答案

Dim yourNumber as Int32 = 5
yourNumber.ToString("D2") '= "05"

这篇关于我怎样才能在任何数字前面得到0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆