|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
printing a zeroI have a program that performs calculations and displays a four digit number.
Sometimes the calculation results in a number like 0854, but my program displays it as 854. How can I force the program to display the leading zero, when the first digit is a zero? I'm only dealing with the integer data type. Instead of using integers you could use a string and determine if the string
is shorter than 4 characters long. If it was shorter you could just add a zero in front of the string. --------------- -Dylan Copeland http://www.dc-studios.net http://www.vbdotnetforum.com Show quoteHide quote "Candace" wrote: > I have a program that performs calculations and displays a four digit number. > Sometimes the calculation results in a number like 0854, but my program > displays it as 854. How can I force the program to display the leading zero, > when the first digit is a zero? I'm only dealing with the integer data type. > Sometimes the calculation results in a number like 0854, but my program number.ToString("0000")> displays it as 854. How can I force the program to display the leading zero, > when the first digit is a zero? I'm only dealing with the integer data type. Candace wrote:
> I have a program that performs calculations and displays a four digit number. ..ToString("0000")> Sometimes the calculation results in a number like 0854, but my program > displays it as 854. How can I force the program to display the leading zero, > when the first digit is a zero? I'm only dealing with the integer data type.
Prevent form minimize
Threading a ShowDialog? - progress form. is there any way to find the position of mouse click on a form dialog to choose folder in vb .net 2005 Minimizing the Console Window reversing the Mod operator Command Prompt or Windows How To Redistribute Office 2003 DLLS CopyMemory(buffer, newBuffer, nBytes)? Datagridview and arraylist |
|||||||||||||||||||||||