Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table cell font problem
Message
 
 
À
04/03/2003 01:42:17
Information générale
Forum:
Internet
Catégorie:
HTML
Divers
Thread ID:
00760189
Message ID:
00760987
Vues:
25
>>I'm not yet sure myself. But I want to know, how should I format currency data.
>
>From an ASP page, with VB Script, you can call Format() with three parameters:
>
>
>< %@ LANGUAGE="VBScript"   
>
>< %
>
>'-------------------------------------------------------------------------------
>' expN1 Length for padding
>' expN2 Value
>' expN3 Number of decimals
>'-------------------------------------------------------------------------------
>Function Format(tnLength,tnValue,tnDecimal)
>lcValue=CStr(tnValue)
>lnPosition=InStr(lcValue,".")
>If lnPosition=0 Then
>   lcFormat=Space(tnLength-Len(lcValue)-1-tnDecimal)+FormatNumber(tnValue,tnDecimal)
>   Else
>   lcFormat=Space(tnLength-lnPosition-tnDecimal)+FormatNumber(tnValue,tnDecimal)
>End If
>Format=lcFormat
>End Function
>
>
>'-------------------------------------------------------------------------------
>' Only used to insert spaces where applicable as per the alignment and the font
>'-------------------------------------------------------------------------------
>Function Space(tnLength)
>lcString=""
>For lnCompteur=1 To lnField
>   lcString=lcString+" "
>Next
>Space=lcString
Should it be For lnCompteur=1 To tnLength? I'm going to use "AddSpaces" name for the function. Also, do you have Option Explicit? Why you don't declare variables? And I believe, we have space function in VB?

Thanks again for the help.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform