LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert string into an integer and shift decimal point to the left

Solved!
Go to solution

Hey guys i have been trying  to convert gps string into an integer, like this

String coming is 2467.8976 and i need to convert it into an integer similar like this 2467.8979 so that i can shift the decimal point to the left (24.678979) which i coudnt do with the string. Its just been my 2 weeks with the labview so be kind. Thankyou 

0 Kudos
Message 1 of 5
(2,722 Views)

Hi Awais07,

 

You can use "Scan from String" function (use quick drop to search for the item). It should change the string to integer.

 

Once converted to integer, I'm sure you'll know how to do the rest.

 

Scan from String:
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/scan_from_string/

 

Warmest regards,

Lennard.C

Learning new things everyday...
0 Kudos
Message 2 of 5
(2,720 Views)

Thanks for your response, Lennard.

I have used "scan from string" and the input string lets suppose is 2467.8989, ouput coming from scan from string is 2467.9  (rounded off?). I have used %f for formatting. I want the whole string, kindly help.

0 Kudos
Message 3 of 5
(2,708 Views)
Solution
Accepted by topic author Awais07

Hi Awais07,

 

Once you created an indicator for the output of the Scan from String, right click on that indicator >> Display Format... >> Increase the value of the Digit to 9

 

Regards,

Lennard.C 

Learning new things everyday...
0 Kudos
Message 4 of 5
(2,694 Views)

Thanks lennard for providing me the best solution. I then divided the integer with 100 and got the desired result. Thank you again. 

0 Kudos
Message 5 of 5
(2,687 Views)