Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper padding to obtain decimal numbers
Message
 
 
À
28/12/2005 03:51:53
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01081185
Message ID:
01081266
Vues:
8
I would just convert the data back to VFP numeric (if not already in that format), and then use STR(xValue,5,2). It will add the trailing zero.

>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform