Results 1 to 3 of 3

Thread: Format() Function in ASP

  1. #1
    Guest
    Does the Format() function work in ASP?

    I've got:
    Code:
    <%=Format(dTotal, "0.00") %>
    dTotal is a variant but will contain money (double) values.
    So, dTotal might contain 2.5 and I'd like the Format() function to return "2.50" or it might contain 2351.101 and I'd want the Format() function to return "2351.10" and I'd tag a "£" sign on the front.

    For some reason, everytime I try to use it I just get
    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'Format'

    /stu/placeorder.asp, line 241

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi matthewralston

    use the FormatCurrency function to do what you ask

    Code:
    FormatCurrency(expression,[numofdiggitsafterdecimal],[includeleadingdiggit],[useparensfornegnums],[groupdigits])
    Hope it helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Guest
    Ta.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width