Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operating on asp variables

Status
Not open for further replies.

neillovell

Programmer
Aug 27, 2002
560
GB
In the code, can I multiple AsHours by 24 in any way? Or do I need to put it in to a variable, then multiple that by 24, and write it?

<p class=&quot;StandOutTahoma&quot;>Total Hours Worked For This Week (as days): <%= rsHours(&quot;AsHours&quot;)%></p>
 
If your variable is already an integer (or other numeric data type), you should be able to simply multiply it by 24.

For example:

<%= (rsHours(&quot;AsHours&quot;) * 24)%>

You might also consider declaring and setting that value elsewhere in your page and then using it here later instead of doing the calculation here. HTH Insanity is merely a state of mind while crazy people have a mind of their own.
 
You may want to convert the value by hand rather than leaving it up to the server to do it:
Code:
<%= (cDbl(rsHours(&quot;AsHours&quot;)) * 24)%>

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top