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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number compare 1

Status
Not open for further replies.

doorbreaker

Programmer
Nov 19, 2002
91
0
0
GB
Hi,

I am having trouble comparing 2 numbers:

I have Minspend: 60 and ProductTotal: 339.2

Code:
<% if minspend < producttotal then %>

do stuff

<% end if %>

This doesn't do anything. However if I change the ProductTotal to anything above 600 then it does work. So it is only looking at the first 2 numbers of my ProductTotal variable.

How do I stop it doing this and look at the entire number?

Thanks

Chris Moore
 
try casting


Code:
<% if cdbl(minspend) < cdbl(producttotal) then %>

do stuff

<% end if %>

Cheers,
Hameed

You are either the slave of what made men or what men made.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top