LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Too many decimals in Textfile

Hi to all labviewers, girls as boys, lady's as gents.

I'm using the labview code in the attached JPG file,(LV vers.7.1 )

to write to a txt file. but can't control the decimals as you can see in the attched example below.

I've tried to change the data range, representation, digits of precision, data type... but no change at all. I always get this 6 decimals beind the comma! and I only needs Two digits, to print out from the text file.

Please help.!

 

Best regards

HFZ

 

Write text file example

TR1-620M
                    8933.654639 R1PO
P              221000.000000 R1PO_
P                  9310.000000 R1PO_

                  

                   11066.433566 R2NO
P                42200.000000 R2NO_
P                15000.000000 R2NO_

 

                 10000.000000 R5IN

 

WriteFile.JPG 

HFZ
0 Kudos
Message 1 of 10
(1,543 Views)

Can you attach you VI?

 

And what is "lady's as gents" Never heard about itSmiley Very HappySmiley Very HappySmiley Very Happy

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 10
(1,539 Views)

6 is default one thats why

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 10
(1,538 Views)

Replace your Express VI with a Write to spreadsheet and you can control those settings (dont forget to activate Append to file).

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 10
(1,528 Views)

cant you just write  it?

HFZ
0 Kudos
Message 5 of 10
(1,449 Views)

Go to the Front Panel - right click on the element of array - Display Format...

And on the Display Format card is property Digits which determines the number of digits after comma (the default settings is 6).

 

Simyfren

0 Kudos
Message 6 of 10
(1,443 Views)
The correct saying is "girls AND boys, ladies AND gents".

HFZ,
If you are going to use an Express VI instead of writing your own code, you have to accept the limitations.

Simyfren,
The display format is totally irrelevant to the format that is written to file.
0 Kudos
Message 7 of 10
(1,437 Views)

Oh, sorry, my fault.

I read wrong what HFZ wrote..

0 Kudos
Message 8 of 10
(1,429 Views)

Hello,

 

My text file is being written with only whole numbers. Does anyone have any idea as to why that would be happening? I have attached a screenshot.

 

Any help is great!

 

Thank you very much,

 

Paige

0 Kudos
Message 9 of 10
(1,310 Views)

You are using the "Number to Decimal String".

Notice the 999 with no decimal point.

Try "Number to Fractional String" instead.

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 10
(1,303 Views)