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: 

labview floating point and decimal differentiation

Solved!
Go to solution

Hi, Can i know what modification can I make to let the display differentiate between floating point and decimal. For example, when I input 2+2. I would like the output of 4 instead of 4.000. And when the input is 2.2 + 2.2, how to get the output of 4.4 instead of 4.4000. And also would like to have keep 4 decimal for trigonometry function.

Download All
0 Kudos
Message 1 of 35
(1,672 Views)

Hi tan,

 

set the display format of your indicator to "hide trailing zeros"…

Spoiler
Something like %#.4g would help…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 35
(1,670 Views)

But the indicator in the VI is string type. There is no option to set hiding trailing zero for that string indicator.

0 Kudos
Message 3 of 35
(1,622 Views)
Solution
Accepted by topic author tan99323

Hi tan,

 


@tan99323 wrote:

But the indicator in the VI is string type. There is no option to set hiding trailing zero for that string indicator.


In this case you are doing the NumToString conversion before displaying the result in an indicator.

Use FormatIntoString with the format string I mentioned in the other message…

 

(Now it would help to provide your VIs for older LabVIEW versions like my LV2017.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 35
(1,609 Views)

In case to enable insert numpad input while the VI is running, what modification can I make ? So user can input date from numpad instead of press those boolean button.

0 Kudos
Message 5 of 35
(1,543 Views)

Hi tan,

 


@tan99323 wrote:

In case to enable insert numpad input while the VI is running, what modification can I make ? So user can input date from numpad instead of press those boolean button.


You need to catch those keypress events…

(Btw. you should use the ValueChange instead of MouseDown events.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 35
(1,534 Views)

I have tried to change the event for 0-9 to value change , but still unable to input from keypad. Which element should i add to the VI ?

0 Kudos
Message 7 of 35
(1,529 Views)

Hi tan,

 

you need to look for keypress events...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 35
(1,518 Views)

So, I need to duplicate the 0-9 mousedown event and change to key down on the new duplicated event ?

0 Kudos
Message 9 of 35
(1,515 Views)

Hi tan,

 

no need to duplicate anything.

Just catch keydown events of your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 35
(1,505 Views)