From a7584b843a64c806ec965a4f38341eb7dbd86e5f Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Mon, 27 Sep 2021 18:29:36 -0500 Subject: Added a test for evaluating an expression & fixed a bug it found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug: non-exact LinearUnitValue instances have their value printed as "(", i.e. "(5.0 ± 0.1) m" will be printed as "( m" --- src/main/java/sevenUnits/unit/LinearUnitValue.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/sevenUnits/unit/LinearUnitValue.java') diff --git a/src/main/java/sevenUnits/unit/LinearUnitValue.java b/src/main/java/sevenUnits/unit/LinearUnitValue.java index a36d568..2219ffd 100644 --- a/src/main/java/sevenUnits/unit/LinearUnitValue.java +++ b/src/main/java/sevenUnits/unit/LinearUnitValue.java @@ -324,12 +324,12 @@ public final class LinearUnitValue { // get rounded strings // if showUncertainty is true, add brackets around the string - final String valueString = showUncertainty ? "(" - : "" + this.value.toString(showUncertainty) - + (showUncertainty ? ")" : ""); - final String baseValueString = showUncertainty ? "(" - : "" + baseValue.toString(showUncertainty) - + (showUncertainty ? ")" : ""); + final String valueString = (showUncertainty ? "(" : "") + + this.value.toString(showUncertainty) + + (showUncertainty ? ")" : ""); + final String baseValueString = (showUncertainty ? "(" : "") + + baseValue.toString(showUncertainty) + + (showUncertainty ? ")" : ""); // create string if (primaryName.isEmpty() && symbol.isEmpty()) -- cgit v1.2.3