LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IHow to force display of trailing zeros for fixed point numbers?

I have an 8 bit unsigned fixed point number, with 7 integer bits and 1 fractional bit, so the desired delta is 0.5. I want it to always display the fractional bit, even when that bit is 0. In other words, as this number is incremented, I want to see:
 
0.0
0.5
1.0
1.5
etc.
 
But instead I'm seeing:
 
0
0.5
1
1.5
etc.
 
I set the display format to Floating point, with 1 digit of precision. The "Hide trailing zeros" checkbox is NOT checked. What am I doing wrong?
 
I realize I could convert to single precision for display purposes to make this happen, but I'd rather make this work with fixed point.
 
Thanks,
 
-Ron
0 Kudos
Message 1 of 13
(5,549 Views)

Ron

 

Check minimum field width and set it to match the desired number of digits of precision. Then select "Pad with Zeroes on Left"

 

 

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 2 of 13
(5,546 Views)
You should select 2 "Significant digits", and keep the "Hide trailing zeros"
untagged.

Regards,

Wiebe.


0 Kudos
Message 3 of 13
(5,535 Views)


VADave wrote:

Ron

Check minimum field width and set it to match the desired number of digits of precision. Then select "Pad with Zeroes on Left"


I just tried that. It puts a bunch of extraneous zeros on the left, but does not show trailing fractional zeros.
0 Kudos
Message 4 of 13
(5,535 Views)

Wiebe@CARYA wrote:
You should select 2 "Significant digits", and keep the "Hide trailing zeros"
untagged.

Regards,

Wiebe.

I tried that. It doesn't show trailing zeros in the fractional part. In addition, once the integer part is 10 or above, the fractional part is no longer displayed at all.
 
I'm using LabVIEW 8.5, if that makes any difference.
0 Kudos
Message 5 of 13
(5,525 Views)
I believe the settings you want are in Display format

Floating point selected in the list on the left
2 digits of precision
and don't hide the trailing zeros


Message Edited by yenknip on 12-05-2007 03:28 PM
_____________________________
- Cheers, Ed
0 Kudos
Message 6 of 13
(5,521 Views)

yenknip wrote:
I believe the settings you want are in Display format

Floating point selected in the list on the left
2 digits of precision
and don't hide the trailing zeros

Message Edited by yenknip on 12-05-2007 03:28 PM

I tried that. It didn't work. I get the same results as before. Theoretically, with your suggestion, I should see:
 
0.00
0.50
1.00
1.50
etc.
 
but I'm seeing:
 
0
0.5
1
1.5
etc.
 
When I select Advanced editing mode, the format string is shown as: %.2f
 
This works if I'm using single or double precision indicators, but not fixed point.
0 Kudos
Message 7 of 13
(5,513 Views)
I just rustled up a VI with what I understand your input to be - unsigned 7 bit mantissa and 1 bit exponent input, and have it displaying 2 decimal places.... Is this what you're after or did I miss it?
_____________________________
- Cheers, Ed
0 Kudos
Message 8 of 13
(5,501 Views)

yenknip wrote:
I just rustled up a VI with what I understand your input to be - unsigned 7 bit mantissa and 1 bit exponent input, and have it displaying 2 decimal places.... Is this what you're after or did I miss it?

That's not quite it. You're using a double (i.e. float) indicator. I want to use a fixed point indicator. My problem is that fixed point indicators don't seem to display trailing zeros in the fractional part, regardless of how their display formats are configured.
 
I'm wondering if that's because I'm doing something wrong, or is there a bug in LabVIEW?
 
0 Kudos
Message 9 of 13
(5,488 Views)
With you now 😉

Yeah, it seems to be a bug in LV. decreasing the number of decimal places truncates the number, but increasing it does not add the trailing zeros.
It looks like you will need to display it as a single or double. Although if it is just being displayed to the user then I would just settle for that anyway.
_____________________________
- Cheers, Ed
0 Kudos
Message 10 of 13
(5,483 Views)