Fix MILES.toKilometers() and KILOMETERS.toMiles()

This mistake should have been caught by DistanceUnitTests.
But the problem is that the tests in this file does not
run during the execution of the test suite, and I don't have
a clue why this is so.
This commit is contained in:
Adriano Ferreira 2010-10-26 15:00:36 -02:00 committed by kimchy
parent 2d15cd8009
commit 9b206146e3
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ public enum DistanceUnit {
}@Override public double toMiles(double distance) {
return distance;
}@Override public double toKilometers(double distance) {
return distance / MILES_KILOMETRES_RATIO;
return distance * MILES_KILOMETRES_RATIO;
}
@Override public String toString(double distance) {
return distance + "mi";
@ -44,7 +44,7 @@ public enum DistanceUnit {
@Override public String toString() {
return "km";
}@Override public double toMiles(double distance) {
return distance * MILES_KILOMETRES_RATIO;
return distance / MILES_KILOMETRES_RATIO;
}@Override public double toKilometers(double distance) {
return distance;
}