LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String data is converting to exponential in excel

Dear sir,

 

I am writing the Hexadecimal String data into excel but it is converting to exponential values whenever "E" comes in between two numbers.

 

Here I am attaching the example VI for easy understanding (observe "text2").

 

I want to write same data not exponential data.

 

Please let me know how to do that.

 

 

Thanks & regards,

S Nagaraju

0 Kudos
Message 1 of 8
(5,172 Views)
You have two options: First, you could surround the hex strings with quotes to tell excel to treat them as strings and not numbers. Of course then the values in excel won't be numbers that you can use in math. The other option is to write the data as decimal numbers and change the display to hex in excel.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(5,160 Views)

Dear sir,

 

Putting in quotes for every data is very difficult and the hex data is acquiring from cusomized digital board.

 

And everything should be done through programmatically no manual changes in excel.

 

Can you please modify the code and attach here if possible..

 

Regards,

S Nagaraju

0 Kudos
Message 3 of 8
(5,139 Views)
Tell you what, I have a job of my own. I don't need yours. Why don't you pick one of the two options and see what you can do. I will gladly advise you one moving forward.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(5,124 Views)

Dear Sir,

 

Sorry, I forgot to delete this sentence "Can you please modify the code and attach here if possible.." in the post.

 

I tried with quotes but it is writing quotes also into excel.

Actually I am receiving thousands of Hex data from the target dynamically and writing into excel.

Showing the data with quotes in each and every cell is looking awkward.

 

Any other possible options.....

 

 

Regards,

S Nagaraju

0 Kudos
Message 5 of 8
(5,103 Views)

@Sonti_11532 wrote:

Showing the data with quotes in each and every cell is looking awkward.


To fool Excel, you actually want a ' (apostrophe) before the text, not quotes around.

 

'1234 will be treated as a string in Excel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(5,082 Views)

The problem is not with LabVIEW, but with Excel.  Open Excel.  Click on a Cell.  Type 0E4, observe 0.00E+00 in the cell.  Excel is doing this.  Excel has built-in "rules" (which LabVIEW cannot change) that governs when it "chooses" to consider the contents of a cell as a string and when as a number that can be displayed in a variety of numeric formats.

 

By your description, all of the data you are writing to Excel are numeric, including 4Edf (= 20191 if counting with fingers).  You have the following logical choice -- send all of the data to Excel as numerics, or send all of the data to Excel as strings.  If you choose to do the former, you will need to take Mike's second suggestion, convert the data to I32, write to Excel (which will treat it as numeric, which it is), and, if you want Excel to display it as numeric, change the cell format appropriately.  If you choose to send all of the data to Excel as strings, you need to take notice that Excel will not "listen to you" unless you force it to accept the string data as strings, and the way to do that is to take Mike's first suggestion (modified by Crossrulz -- I'm surprised you didn't figure this out yourself -- does this mean you (a) don't know LabVIEW and (b) you don't know Excel?  Oh, dear ...).

 

To paraphrase Mike's second message, "You Pays Your Money and You Takes Your Choice".

 

Bob Schor

0 Kudos
Message 7 of 8
(5,056 Views)

Use Hexadecimal String To Number to convert text1 and text2 to number before connecting the resulting number value to the "text" input of Append Report Text.vi and set the "format string" input of Append Report Text.vi to %x

 

Ben64

0 Kudos
Message 8 of 8
(5,028 Views)