• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 488
  • Last Modified:

response.write blue font in asp

Greeting,

I have the following line in asp and need to write the fonts in blue. Please suggest.

Response.Write "Grand Total: " +FormatCurrency(CStr(total),2)


Thanks.
0
mrong
Asked:
mrong
  • 2
  • 2
1 Solution
 
WebDevEMCommented:
Response.Write "Grand Total: <span style='color:#00f;'>" +FormatCurrency(CStr(total),2) + "</span>"

Open in new window

0
 
mrongAuthor Commented:
Tried and got the following error.

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'FormatCurrency'
0
 
WebDevEMCommented:
Sorry, I copy/pasted your original code and added the coloring... combining 2 strings should be done with "&" not "+" and the Response.Write needs parens around it:
Response.Write ("Grand Total: <span style='color:#00f;'>" & FormatCurrency(CStr(total),2) & "</span>")

Open in new window


I don't have an ASP server I can test this on quickly, but that should do it.  I'll try to connect to a server and see if I can test it out.

UPDATE:  If I change the "total" to 100 it works on my server.  What is your "total" variable defined as?  If ASP can't convert total with CStr, then it could fail when it tries to format it as currency.
0
 
mrongAuthor Commented:
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now