Android Question Parsing a relative string to an integer

Cableguy

Expert
Licensed 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
 

Cableguy

Expert
Licensed 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)
 

RandomCoder

Well-Known Member
Licensed User
Lol.... I found a workaround... Not in parsing but in my way of making my calculations
Hi @Cableguy is this for what I think it is ;)
Just store the value you want to use and then multiply it by 1%x or 1%y as required.
 

Cableguy

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