Android Question Parsing a relative string to an integer

Cableguy

Expert
Licensed User
Longtime User
Hi guys...

I have a file that has or will have some relative string values like "1.3%x"... but if I feed this string into a map and try to use it as an integer... it fails... obviously...
How can I parse this relative string into an integer?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Get the needed subpart of the string (1.3) and cast it to a float or double
1.3 can not be an int.

Maybe i did not understand the question right. Dont know what you mean with "relative string"
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
the string is a screen relative percentage like in the example 1.3%x... if I put this into the map without the quotes it works and gets converted to an integer screen value... but with the quotes I get an error... so i'm guessing I will have that error once I read that value from a file ( not yet implemented)
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Lol.... I found a workaround... Not in parsing but in my way of making my calculations
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
indeed... I'll send you a new dropbox link ... decided to re-think the whole initialization procedure...
 
Upvote 0
Top