For Programmers: Free Programming Magazines  


Home > Archive > ASP > October 2004 > Error with formatcurrency statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Error with formatcurrency statement
Jack

2004-10-21, 8:55 pm

Hi,
I got the following line in the formatcurrency statement that is giving error.
Response.write "<TD ALIGN=RIGHT WIDTH='10%' >" &
FormatCurrency(TotPersonnel) & "</TD>" & vbCRLF

The error message is:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'formatcurrency'
/gwisprod/FSR_EditDetailPrint.asp, line 345

I found out that if TotPersonnel field contains null value, the above error
gets generated. Any help is appreciated here. Thanks.
Ray Costanzo [MVP]

2004-10-21, 8:55 pm

The quick and dirty fix:

FormatCurrency("0" & TotPersonnel)

Ray at work


"Jack" <Jack@discussions.microsoft.com> wrote in message
news:30E07662-9D58-446F-9426-CEE3E79CC3EE@microsoft.com...
> Hi,
> I got the following line in the formatcurrency statement that is giving
> error.
> Response.write "<TD ALIGN=RIGHT WIDTH='10%' >" &
> FormatCurrency(TotPersonnel) & "</TD>" & vbCRLF
>
> The error message is:
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: 'formatcurrency'
> /gwisprod/FSR_EditDetailPrint.asp, line 345
>
> I found out that if TotPersonnel field contains null value, the above
> error
> gets generated. Any help is appreciated here. Thanks.



Larry Bud

2004-10-22, 3:55 pm

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<uL5jXg7tEHA.1204@TK2MSFTNGP10.phx.gbl>...
> The quick and dirty fix:
>
> FormatCurrency("0" & TotPersonnel)
>


Great idea... can't believe I never thought of it! :-)
Ray Costanzo [MVP]

2004-10-22, 3:55 pm

Yeah, it handles nulls and empties all in one swoop. :]

Ray at work

"Larry Bud" <larrybud2002@yahoo.com> wrote in message
news:5db363e0.0410220944.2e90dd80@posting.google.com...
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:<uL5jXg7tEHA.1204@TK2MSFTNGP10.phx.gbl>...
>
> Great idea... can't believe I never thought of it! :-)



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com