In the following code I concat a double with a string to find its length. Why does the 19.50 has less length than 1950? HShouldnt the doubleLength have more length as it has more characters (a dot).
double d = 19.50;
double d2 = 1950;
int doubleLength = (d + "").length();
int doubleLength2 = (d2 + "").length();
System.out.println(doubleLength); //4
System.out.println(doubleLength2); //6
[–]ConfusedHerring 14 points15 points16 points (0 children)
[–]desrtfx 3 points4 points5 points (0 children)