Format number function problem
I have a traffic light system that show product performace at basses. This was a finished page until the client wanted to weight the products and the bases. Weightings are between 0 and 1.0 - There are two select boxes on the page that allow you to filter the results EG. Only show me products where the weighting = 1.0 or = .5 etc. You may choose a baseWeighting, productWeighting or a combination of the two.
The values being passed in the select boxes are as illustrated above however there is now a need to include EG where someWeighting <=.5 Or someWeighting >=.5
I am using the FormatNumber function to ensure values are being compared like so 1.0 or .1 or .5 etc. The two IF conditions below work like a treat when there is no < or > involved in the values being compared. When either of these two conditions are asked for they are put into the variables:
1..prodFilter = selected product filter condition
2..baseFilter = selected base filter condition
They are being compared to the weighting values:
1..reviews(4) = productWeighting
2..bases(2) = baseWeighting
The page errors out when either >.5 or <.5 conditions are selected, otherwise it works trouble free. I know why I get the error: You cant run the formatNumber function against a value that has > or < within - I am having a little trouble finding a solution. Here is the start of the statement that detects a filter has been asked for:
IF (prodFilter <> "" AND prodFilter <> "all") or (baseFilter <> "" AND baseFilter <> "all") THEN
IF (formatNumber("0" & prodFilter,1) = formatNumber("0" & reviews(4),1)) OR formatNumber("0" & baseFilter,1) = formatNumber("0" & bases(2),1) THEN....
Wind is your friend
Matt
__________________
Wind is your friend
Matt
|