Denis Orozco
asked on
Find if a number is part of a range
Hi there,
I have a little bit of an issue. I need to find out if a number is part of a giving range.
I have the following code:
5.000
6.00000
1.0000
23000.00
And ranges are like this:
1
2 to 5
6 to 20
21 to 50
50 >
For the bigger numbers those are dollars amounts and behave the same way.
How can I do this?
Thanks
I have a little bit of an issue. I need to find out if a number is part of a giving range.
I have the following code:
Dim dt as new datatable
Dim dtrow as datarow
Dt = loaddata()
For each dtrow in dt.rows then
Dim str as string = dtrow.items("unit").tostring()
Dim range as string = dtrow.items("range").tostring()
'Some how in here I need create a function or sub that will tell me if the str is in my range or not
Next
The datatable has units like this 5.000
6.00000
1.0000
23000.00
And ranges are like this:
1
2 to 5
6 to 20
21 to 50
50 >
For the bigger numbers those are dollars amounts and behave the same way.
How can I do this?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what kind of "Categories" need to be defined here? How you define these categories?
ASKER