10-20-2008 01:31 PM
Hi guys,
I have a number 350.00
I need to make 350.0
How to do that on LV8.6?
thanks in advance.
10-20-2008 02:15 PM
10-20-2008 03:07 PM
This is probably just a purely cosmetic formatting issue. If you want to e.g. truncate a number to 1 significant digit, you would need to d a bit more code.
Ravens solution applies to front panel controls and indicators, but you have not told us the details of the problem so we can only guess.
(Other possible interpertations would be for example if you want to write such a number to a file or to a text indicator or if this "number" is actually not a numeric datatype but a formatted string to begin with).
What is the datatype of the "number"? Where does it come from?
10-20-2008 05:01 PM
As altenbach said it depends on your problem.
If you just want the front panel to display it differently, right click and change the format.
If you want the number to be written to somewhere (a file/function) in a different format,
you could use a numeric conversion.
Functions >> Numeric >> Conversion
From there, theres a bunch of functions that can convert for you.
10-20-2008 05:05 PM
I guess to elaborate on your question:
Right now your number is formatted (it appears) as
%.2f
You want
%.1f
the number before the 'f' signifies the number of decimal places
10-21-2008 04:16 AM
Hi again,
Couldn't solve it yet!
Could not find really clear help for "Fixed-Point Function", unclear what is "fixed-point type" and no examples in LabVIEW 8.6 help. DISAPPOINTING!
I include the.vi in the attachments.
Hi guys,
I have a number 350.00
I need to make 350.0
How to do that on LV8.6?
thanks in advance.
10-21-2008 05:30 AM
Problem solved,
turns out subvi does the conversion itself.
However it is very bad that LabVIEW does not have NUMBER precision control (decimal point)!!! shame!
10-21-2008 10:47 AM
testas123 wrote:However it is very bad that LabVIEW does not have NUMBER precision control (decimal point)!!! shame!
Well, you can always write your own subVI with a few strokes of the mouse. 🙂
If you are talking about truncation (a data operation) and not formatting (a cosmetic issues), be aware that many nice and round decimal digits cannot be correctly represented in binary, so you might still be slightly off when you would display e.g. 16 decimal digits.
08-10-2009 04:56 PM
08-10-2009 05:21 PM