Jump to content

String to DBL with decimal power


sVeNvAeTh

Recommended Posts

QUOTE(sVeNvAeTh @ Sep 24 2007, 10:54 AM)

I have to convert a string in a DBL. That is no problem, but the string uses decimal power,

like 1.54 E+02.

Now, I get the right value, but it only shows 1.54 and not the decimal power.

What is the mistake?

The white space before the exponent is the problem... LabVIEW needs 1.54E+02. There are numerous ways of solving this. You could for example use "search and replace string " and replace '/sE+' by 'E+'.

Link to comment

QUOTE(sVeNvAeTh @ Sep 24 2007, 01:11 PM)

i tried it, but it doesnt work. i still see the space between 1.54 and E+01.

i insert a search an replace string and on left i put in the result string, the '/sE+' and the 'E+'.

Try searching for " ", and replace this with "" (without the qoutes).

The search string "\s" (notice backslash), is the \-code view of a space character (To view any string in LabVIEW as \-code, right click on the string and select "\"-codes display)

You should also wire the "Replace All" terminal with a TRUE constant, to get rid of all spaces.

Good luck

/J

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.