Following capx performs how I picked closest value in list:
dropbox.com/s/jxni8fjxfg5qy5m/closest_value.capx
A tested value ranged from 0 to 90 driven by slider bar value. Given list are; [ 0, 5, 16, 33, 90 ] and these numbers have difference interval.
So if test_value is 7 the program yields 5 as picked_value since the difference between 7 to 5 is smaller than difference between 7 to 16. If test_value is 12 of course it will pick 16 as picked_value.
The question is:
Is there any alternative way to pick closest value from provided list of numbers? Usually I use object to pick which one nearest to certain position value but this time I try to avoid using that approach.