Forum Moderators: open

Message Too Old, No Replies

Formatting and highlighting ASP table - help?

How to formatting number and highlighting rows...with ASP?

         

SpyderWeb

11:45 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



Hello,

Looking for a way to format my numbers to 2 decimal places as I build my table, can
Combining :
formatnumber(recordset("Price"),2)
response.write "<td>" & recordset("Price") & "</td>"

into :
response.write "<td>" & formatnumber(recordset("Price"),2) & "</td>"
work?

Also would like to highlight cell or row background based on numbers value.
Any ideas would help.

Thanks,
SW

TheNige

1:32 am on Mar 18, 2004 (gmt 0)

10+ Year Member



do a search on google for "asp formatcurrency"

as for changing the color of the row you can make a function that will dynamically change the class of the cell such as:

response.write "<td class=" & FormatCellColor(recordset("Price")) & ">" & formatcurrency(recordset("Price")) & "</td>"

function FormatCellColor(ByVal myVal)
If myVal > 0 then
FormatCellColor = "GreyCell"
Else
FormatCellColor = "RedCell"
End If
end function

that is one way to do it.

SpyderWeb

2:35 am on Mar 18, 2004 (gmt 0)

10+ Year Member



TheNige,

Thank you for your reponses.
It's a great help.

SW