Skip to content

Commit

Permalink
Don't use scientific notation for double formatting in Text Boxes (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored and PeterJohnson committed Dec 8, 2019
1 parent 0be5223 commit 5dea736
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/edu/wpi/first/smartdashboard/gui/Widget.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.awt.event.ComponentListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.math.BigDecimal;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
Expand Down Expand Up @@ -361,7 +360,7 @@ protected void resetValue() {
@Override
public void setBindableValue(double value) {
this.value = value;
setText(Double.toString((new BigDecimal(value)).stripTrailingZeros().doubleValue()));
setText(String.format("%f", Double.valueOf(value)));
}

protected abstract boolean setValue(double value);
Expand Down

0 comments on commit 5dea736

Please sign in to comment.