Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number issue
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01098207
Message ID:
01098218
Vues:
11
>Alright, I'm having a number issue:
>
>I'm making a number of computations and then displaying the results, the number can be anything from 0 to 99, the only problem I'm hving is when its 0 through 9 I want to display it with a 0 in front (example: 03). I tried to find some kind of formatting in the .TOstring("n2") but that didnt seem to to work, any help would be appreciated. TIA!
int i = 8;
string s = i.ToString().PadLeft(2,'0');
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform