09-04-2012 06:32 AM
In my application i am saving the data ( 78°20.54 E )coming from gps in tdms format in the pc.
There are many such strings to save , so as this takes more memory to save the data in pc i want to type case in floating and save .
I am typecasting But i am not able to retrive the same data 78°20.54 E while again type casting .
Please see the attached vi.
Regards
Naga
09-04-2012 06:54 AM
Take a look at the string palette, specifically:
Format into string
Scan from string
09-04-2012 07:55 AM
You can't simply typecast a string like "78°20.54 E" directly to a floating point number. That makes no sense. What is the degree symbol supposed to be type-cast to? What is the space supposed to be typecast to?
If your intent is to reduce the space storage requirement, then you need to convert the string to an appropriate coordinate system. I would suggest doing some reading on latitude/longitude coordinate systems.
09-04-2012 08:27 AM
@smercurio_fc wrote:
You can't simply typecast a string like "78°20.54 E" directly to a floating point number. That makes no sense. What is the degree symbol supposed to be type-cast to? What is the space supposed to be typecast to?
If your intent is to reduce the space storage requirement, then you need to convert the string to an appropriate coordinate system. I would suggest doing some reading on latitude/longitude coordinate systems.
I don't see any need to change the coordinate system. What would he gain? All he has to do is convert the lat/long values to decimal degrees and store.
09-04-2012 08:41 AM
@Spruce wrote:
@smercurio_fc wrote:
You can't simply typecast a string like "78°20.54 E" directly to a floating point number. That makes no sense. What is the degree symbol supposed to be type-cast to? What is the space supposed to be typecast to?
If your intent is to reduce the space storage requirement, then you need to convert the string to an appropriate coordinate system. I would suggest doing some reading on latitude/longitude coordinate systems.
I don't see any need to change the coordinate system. What would he gain? All he has to do is convert the lat/long values to decimal degrees and store.
I was referring to something that did not involve characters like a degree symbol, spaces, and N, S, E, W. In other words, something completely numeric. Perhaps conveting to decimal degrees is sufficient. I don't know. The question posted by the user was why it didn't work. And the answer is that it makes no sense to try what the user was trying to do in the first place.
09-04-2012 11:18 AM
@smercurio_fc wrote:
I was referring to something that did not involve characters like a degree symbol, spaces, and N, S, E, W. In other words, something completely numeric. Perhaps conveting to decimal degrees is sufficient. I don't know. The question posted by the user was why it didn't work. And the answer is that it makes no sense to try what the user was trying to do in the first place.
Actually, his question was how to convert the string representation to floating point and back again.
09-04-2012 11:31 AM
Re-read the question.
09-04-2012 11:40 AM
Nagaa,
You might want to better explain exactly what you want.
Do you want "78°20.54" to be 78.3423 (I'm assuming after the ° is minutes)? Then have E be positive and W be negative?
09-04-2012 11:20 PM
Hello every one
I just want to convert the strings like 78°20.54 E to some floating point and save this in pc so that i can save file memory . and retrive again the same value ( 78°20.54 E ) to represent in the report generation
09-05-2012 06:43 AM
@smercurio_fc wrote:
Re-read the question.
I did. He's still asking how to convert the string to float and back again.