Quantcast
Viewing all articles
Browse latest Browse all 5175

How to get nearest element from List expression

Hi All,

I am trying to find the nearest number element from the given list of numbers. Imagine there are two expression1 and expression2 with data as mentioned below, the outcome I am expecting as expression3

Example:

expression1 = 140;  (number type)

expression2 = {20, 25, 30, 40, 50, 80, 100, 125, 150, 200, 300, 500, 750, 1000} ; (list type)

expression3= 150 (number type)

It will be added value, if we can choose direction like floor, round and ceiling, so that I can pick 125, 150 looking forward for kind support.

 

Solution in NX8.5 and higher is OK.


Viewing all articles
Browse latest Browse all 5175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>