LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert engineering string into a number



@altenbach wrote:

(You seem to convert all decimal points to commas, thus you probably use a non-US OS (German?). If all your strings have decimal points instead of commas, you can just disable the local decimal point in "Fract/Exp String to Number" as shown. Your version actually does not work correctly on an US computer, because the commas are not recognized as decimal separator here.)


As an additional note, remember that you can programmatically switch between period decimal and comma decimal format, by using the following silent formatting codes:

%,; --> Comma decimal separator
%.; --> Period Decimal separator
%;  --> System default sperator

Check the online help for more details. 🙂
0 Kudos
Message 11 of 15
(2,157 Views)
Hello,
I just got a funny problem with the "Fract/Exp String To Number" function in LV 8.5. First a Windows feature, that was not known to me. I set the point as decimal separator in the regional options as usually. When my colleague logged in for the first time on this maschine the regional options were set back to default European
(with comma as decimal separator).
OK, here comes the problem with the "Fract/Exp String To Number" function: While I converted some DBL numbers in the VI into Strings and convert them back on another place (please don't ask why, I should change this immediately 😉 the "Fract/Exp String To Number" simply does not recognise the system's decimal separator even when the input "use system decimal point (T)" is left to default. Or could it be only my misunderstanding, that in this case it's meant as only "decimal point" and nothing else?
Ciao
Olli

0 Kudos
Message 12 of 15
(1,941 Views)

Yes.  Regional settings are a function of which user is logged in.  Each user can have their own settings.  For a new user who has never logged in before, Windows sets their settings to some default.  I'm not sure how you can change the defaults that Windows uses.

I'm not clear on exactly what your problem is.  Can you post an example of the code you are using?  Is it comma or period that is being used in the string?  What is the regional setting for the user logged in?

0 Kudos
Message 13 of 15
(1,937 Views)
Hello Ravens Fan,
thanks for the reply! In fact I should have taken a cup of tea and thought it over before posting my question. The string I convert into a fractional number comes from another device. There the decimal separator is always a point not a comma....and so with the new regional settings of the new user the "Fract/Exp String To Number" function  gave a correct output (by ignoring the point).
I will replace this function with the "Scan From String" function and specify the format of the number exactly, because this format will never change. Then it will be working with an regional setting of windows.
Ciao
Olli

0 Kudos
Message 14 of 15
(1,914 Views)
...or simply switch the "Fract/Exp String To Number" separator to "period"....I did not recognise this word as synonyme for the word "point".
OK this is time now for a strong coffee.
Greetings
Olli
0 Kudos
Message 15 of 15
(1,910 Views)