Start updating length (int -> float).

This commit is contained in:
Mikael Capelle
2018-03-09 14:12:21 +01:00
parent 85fb193808
commit 3e6bcb0665
7 changed files with 19 additions and 13 deletions

View File

@@ -126,9 +126,9 @@ public class PathsPanel extends JPanel implements DrawingChangeListener, GraphCh
String info = "";
// Display length
int length = path.getLength();
float length = path.getLength();
if (length < 2000) {
info += String.format("Length = %d meters", length);
info += String.format("Length = %.1f meters", length);
}
else {
info += String.format("Length = %.3f kilometers", length / 1000.);