LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number to string precision

I want to convert an array to a spreadsheet string. The array has 2 dimensions of seonds,value. Seconds is the value returned by the "Get Date/Time In Seconds" function.

I find that the "Array to Spreadsheet String" function will truncate the seconds value because it is more than 6 digits long.

I can force extra digits by using a format string of "%.9e" which gives an exponential representation with 9 digits of precision.
This is fine but it pads the last few digits with zeroes if they aren't needed.

Is there any trick I'm ignorant of that will convert a number to a string of >6 digits precision and automatically use the correct number of digits to avoid the extra zeroes? I've hunted through online help and this site with no luck so I expect the short answer is "No." but I figure I should ask.

I'm running Labview 5.1.1 on a Mac under OS9 because NI will not supply an OSX driver for the PCI-GPIB boards that we use throughout our experiment.
I know we're crazy, we need to cough up the cash for a different interface, we just so far have not had enough incentive. Do later versions of Labview perhaps overcome the 6 digit limitation?

Thanks.
0 Kudos
Message 1 of 5
(3,520 Views)
My bad, as far as the lack of driver for PCI-GPIB. I just remembered that had been released. The reason we haven't switched is that our experiment uses a couple of acquisition systems using the MXI-VXI interface that does not have an OSX driver.

I'm still wondering about the number to string conversion precision thing though...
0 Kudos
Message 2 of 5
(3,519 Views)
I've used the attached VI to do what you describe. I format the number, trim off all trailing zeros, check to see if the string then ends in a decimal point and if it does add back in one zero.
Message 3 of 5
(3,513 Views)
Thanks, but I can't open this file with LabView 5.1.1 on a Mac. Is it a later version? Could you post it archived or compressed?
0 Kudos
Message 4 of 5
(3,477 Views)

Here is a picture of the block diagram:  In the case structure, case 0.. is shown, case ..-1 is not shown but it is just a straight wire from input to output.  Same with next case, straight wire from input to output for case not shown "".

Message Edited by tbob on 03-21-200605:19 PM

Message Edited by tbob on 03-21-200605:22 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 5
(3,476 Views)