From 987fd8406d65505aedecd17e51216eb0ce393fbb Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Wed, 22 May 2019 17:32:40 -0400 Subject: Added new default methods to the Unit interface. --- src/org/unitConverter/converterGUI/UnitConverterGUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org/unitConverter/converterGUI/UnitConverterGUI.java') diff --git a/src/org/unitConverter/converterGUI/UnitConverterGUI.java b/src/org/unitConverter/converterGUI/UnitConverterGUI.java index e258c6f..2d3d1a5 100755 --- a/src/org/unitConverter/converterGUI/UnitConverterGUI.java +++ b/src/org/unitConverter/converterGUI/UnitConverterGUI.java @@ -191,7 +191,7 @@ final class UnitConverterGUI { return; } final double beforeValue = Double.parseDouble(input); - final double value = to.convertFromBase(from.convertToBase(beforeValue)); + final double value = from.convertTo(to, beforeValue); final String output = this.getRoundedString(value); @@ -254,7 +254,7 @@ final class UnitConverterGUI { return; } - value = to.convertFromBase(from.convertToBase(1)); + value = from.convertTo(to, 1); // round value final String output = this.getRoundedString(value); -- cgit v1.2.3