Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69295

Numeric fraction input, 1 3/4, 1 11/16, 7/8 etc..

$
0
0

Is there a built-in way to convert a integer-fraction notation (enterd by a user on FP) to it's approximate double precision value?

 

For instance, if the user types "1", then the double precision value is simply 1, if they type "1 11/16" then the value would be interpreted as 1.6875. By default, labview ignores non-numeric data entered into a numeric control so typing "1 11/16" does nothing.

 

I know I could brute force this by using a string control, testing for a space after the first integer and parsing out the numbers before and after a "/" or "\" ...and so on, but I was wondering if there is an easier way, more elegant way to handle this.


Viewing all articles
Browse latest Browse all 69295

Trending Articles



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