FormatCurrency

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • r90slash6
    New Member
    • Sep 2008
    • 9

    FormatCurrency

    Hi,

    I am trying to display a field as currency from a recordset to a text field to my asp page. I am using FormatCurrency vbscript function. Everything works as designed if the field displayed contains a number. However, if the field is null, I receive a VBScript runtime error '800a000d.

    Below is the code:
    Code:
    <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<%= FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) %>" />
    Below is how I am trying to avoid the error but receive a Microsoft VBScript compilation error '800a0414' Cannot use parentheses when calling a Sub
    when the page opens:
    Code:
    <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<% If IsNumeric (LastEacTotCapRs.Fields.Item("TotalCapEac").Value) Then FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) End If %>" />
    Am I at all close to the correct this error message? or am I way of course?

    Any suggestions is appreciated. Thanks
    Tom
  • r90slash6
    New Member
    • Sep 2008
    • 9

    #2
    I found any answer on Byte. I used: FormatCurrency( "0" & (number))

    Comment

    Working...