Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table cell font problem
Message
 
 
To
04/03/2003 01:42:17
General information
Forum:
Internet
Category:
HTML
Miscellaneous
Thread ID:
00760189
Message ID:
00760987
Views:
26
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform