CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 displaying currency symbols

Print topic Send  topic

Author Message
bfieldmom
Posted: 05/13/2002, 7:48 PM

i pulled the code below from the community, but when i try to go live, i get the following error:
Microsoft VBScript compilation error '800a03ed'
Expected '('
/michele/Common.asp, line 224
Function fldPrice = NumFormat(fldPrice,"c",0)
------------------^

code:
Responses
Topic How do I make currency appear in the grid?
Author kmc
Date Created 8/2/01 6:53:25 PM
Message This was posted on the newsgroup months ago - not by me.
Put it in you 'modules' and use it in before show event for any numeric type field you need to format.


Function NumFormat(iNum,iType,iRnd)
'// use to format numeric fields.
'// valid iTypes are "c" for currency, "n" for numeric, "p" for percent.
'// iRnd is number of decimal places to round to.
'// Example fldAmount = NumFormat(fldAmount,"c",2)
'//
iNum = Cstr(iNum)
iRnd = Cstr(iRnd)

'// Check to see if value passed is a number, if not
'// just return the value.
If IsNumeric(iNum) = false Then
NumFormat = iNum
Exit Function
End If

'// Determine itype and format accordingly.
Select Case Itype
Case "n","N"
NumFormat = FormatNumber(iNum,iRnd)
Case "c","C"
NumFormat = FormatCurrency(iNum,iRnd)
Case "p","P"
NumFormat = FormatPercent(iNUm,iRnd)
Case Else
NumFormat = iNum
End Select

End Function
Alex Alexapolsky
Posted: 05/14/2002, 2:50 AM

This like has incorrect vbscript syntax :

Function fldPrice = NumFormat(fldPrice,"c",0)

it could be

fldPrice = NumFormat(fldPrice,"c",0)



   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.