Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table cell font problem
Message
De
04/03/2003 01:42:17
 
 
Information générale
Forum:
Internet
Catégorie:
HTML
Divers
Thread ID:
00760189
Message ID:
00760761
Vues:
28
>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
End Function

%>

< %=Format(6,2.1,2)%>
For example, the call to the Format() function here would format the value 2.1 in currency, thus two decimals places.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform