I want to parse a string in the format '5.3984.234' and convert it to a float. Obviously the float will be 5.3984
In C, using atof() will give this result, but in Java, Float.parseFloat() and Float.valueOf() both throw exception.
I do not want the function throwing an exception and want the identical functionality of atof() How can I do this?
Note: I can't guarantee there is always two periods in the string. Sometimes it might be 48328.458, other times 4823.5482.4822 or even 42894.4383.8349.439