matching numbers

They have: 2 posts

Joined: Dec 1999

is there a way to match a number with a range of percentages?

such as...
the three numbers are 13 48 98
you want to put each in one of 2 fields, 0-50% 50-100% of 100

so 13 would go in 0-50% and 48 would do the same, 98 would go in 50-100%

make sense?

well, i can't figure out how in the world to do it so any help would be greatly appreciated.

assasasa

They have: 850 posts

Joined: Jul 1999

Not sure if I exactly understand the question, but try somthing like this

Code Sample:

foreach $num(@numbers)
{
if($num <=49)
{
push(@group1,$num);
}
if($num>=50)
{
push(@group2,$num);
}

}

The array @group1 contains everything under 50 and @group2 contains everything over 50.

Hope that helps a little.

------------------
Elephants are the only mammals that can't jump.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.