转换为数字而不会丢失零VB [英] Convert to number without losing zeros VB
问题描述
你好。
有没有办法维持这种形式的号码格式:
00238
00250
最初这些数字是项目中的字符串,它们在我的数据库中保存为varchar,但是我需要从这两个生成一个连续的序列,以实现我将数字传递给int,但有了这个,显然删除了前导零。
只是为了清除我对它的好奇心,我已经将所有连续出版物保存到带有前导零的数据库中,但是我把它作为原始字符串的长度并对生成的序列进行了比较原文。
提前致谢
Hello there.
Is there a way to maintain the format of a number in this form:
00238
00250
Initially those numbers are a string in the project and they are saved as varchar in my database, but I need to generate a consecutive serial from those two, to achieve that I pass the numbers to int, but with this the leading zeros are obviously removed.
Is just to clear my curiosity about it, I already save all the serials into the database with the leading zeros but I made this taking the length of the original string and making a comparison of the serial generated with the original.
Thanks in advance
推荐答案
阅读以下内容:http://stackoverflow.com/questions/3961248/tostring-preserve-leading-zeros [ ^ ]
Read the following : http://stackoverflow.com/questions/3961248/tostring-preserve-leading-zeros[^]
这篇关于转换为数字而不会丢失零VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!