From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I display decimal data on the front panel as fractions such as 1/32, 1/16

I would like to convert my metric measurement data into inches and have the data displayed as fractional inches such as "1/32", "1/16" etc. Thank you.
0 Kudos
Message 1 of 30
(5,251 Views)
I don't think that there is a way to display a number as a fraction in a numeric indicator. You can, however, figure out its fractional value and display it as a string. I've whipped up something that I think works fairly well. I'm not sure if its the best way to do it, but its my best attempt. Hope it helps!

Brian
Message 2 of 30
(5,247 Views)
Brian, yes it did help and thank you for attaching the file. I have been reviewing it and it is helping me to further understand how to program what I need in LabView. Thanks again. Craig
0 Kudos
Message 7 of 30
(5,247 Views)
As Brian said,this function is most likely missing in LabVIEW at this point.

Here is an alternative solution to your problem though. It is based on a "binary" set of fractions, i.e only 2, 4, 8, 16, 32 ... are allowed in the denominator. The VI has a resolution setting allowing the user to specify the maximum resolution (highest number in the denominator). I hope this helps. /Mikael
Message 3 of 30
(5,247 Views)
I am sorry. I just found a bug. Here is a corrected version. 🙂 /Mikael
0 Kudos
Message 4 of 30
(5,247 Views)
Nice, looks better than mine... 🙂
0 Kudos
Message 6 of 30
(5,247 Views)
Mikael, Thank you very much for the reply! That project had come to a stop and now it is moving forward again. I greatly appreciate that you attached the file – I would not have been able to build what you did (at least not yet). Regards, Craig
0 Kudos
Message 8 of 30
(5,247 Views)
I think you could pretty easily write a program to convert numbers to string
fractions. But you would have to decide how you wanted to round it off
unless you don't mind ending up with 3271/16384ths.

"cvr" wrote in message
news:506500000008000000772C0000-1000509150000@exchange.ni.com...
> I would like to convert my metric measurement data into inches and
> have the data displayed as fractional inches such as "1/32", "1/16"
> etc. Thank you.
0 Kudos
Message 5 of 30
(5,247 Views)

Can someone convert the above solution to labview 8 or 9?

0 Kudos
Message 9 of 30
(4,828 Views)

Here it is in v8.2

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 10 of 30
(4,791 Views)