Question: I'm trying to add two values together e.g. 14.0 + 2.1 = 16.1 but I keep on getting them added onto each other e.g 14.0 + 2.1 = 14.02.1

```
var miledistance = miledistance1 + miledistance2;

```

Answer: 
For Java:

Make sure they are both float values.  

Try casting:

```
miledistance = (float) miledistance1 + (float) miledistance2;

```

Or use [`Float.valueOf()`](http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Float.html#valueOf(java.lang.String)):

```
miledistance = Float.valueOf(miledistance1) + Float.valueOf(miledistance2);

```

---

For Javascript:

```
miledistance = parseFloat(miledistance1) + parseFloat(miledistance2);

```

---

*NOTE*: Java and javascript are **not** the same language.
It seems to be that the program is treating them as strings, cast them as float or double.