Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper padding to obtain decimal numbers
Message
De
28/12/2005 03:51:53
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Proper padding to obtain decimal numbers
Divers
Thread ID:
01081185
Message ID:
01081185
Vues:
56
I am looking for the proper padding to obtain a padding for the last digit, for example, if it is a zero. I have a table having a field which contains some values like 8.5, 12.12, 1.2, 1.24. Those values should be shown as 8.50, 12.12, 1.20 and 1.24. This comes from a numeric field (5,2) in VFP. I am getting that data in VB.NET by the use of OleDbAdapter. Once the data is in a view, I am doing this:
            lcHtml = lcHtml + "<TD ALIGN=RIGHT>" + _
             loDataProvider.oDataView(lnCounter).Row("Elapse").ToString.PadLeft(5, "0")
However, despite the fact that this works as I obtain a zero at the end, when needed, it also adds a zero in front for numbers less than 10. How can I adjust that to obtain the number I indicated at the top?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform