This kind of conversion is actually incredibly unintuitive in Java
Take, for example, the following line: "100.00"
C: a simple standard library function since at least 1971 ( Where did the name `atoi` come from? )
int i = atoi(decimalstring);
Java: mandatory pass through double (or Float) parsing followed by listing
int i = (int)Double.parseDouble(decimalstring);
Java probably has some oddities up its sleeve
Raywell Sep 09 '13 at 13:11 2013-09-09 13:11
source share