Skip to content

Commit 5dea736

Browse files
ThadHousePeterJohnson
authored andcommitted
Don't use scientific notation for double formatting in Text Boxes (#130)
1 parent 0be5223 commit 5dea736

File tree

1 file changed

+1
-2
lines changed
  • src/main/java/edu/wpi/first/smartdashboard/gui

1 file changed

+1
-2
lines changed

src/main/java/edu/wpi/first/smartdashboard/gui/Widget.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import java.awt.event.ComponentListener;
1313
import java.awt.event.FocusEvent;
1414
import java.awt.event.FocusListener;
15-
import java.math.BigDecimal;
1615
import javax.swing.BorderFactory;
1716
import javax.swing.JCheckBox;
1817
import javax.swing.JComponent;
@@ -361,7 +360,7 @@ protected void resetValue() {
361360
@Override
362361
public void setBindableValue(double value) {
363362
this.value = value;
364-
setText(Double.toString((new BigDecimal(value)).stripTrailingZeros().doubleValue()));
363+
setText(String.format("%f", Double.valueOf(value)));
365364
}
366365

367366
protected abstract boolean setValue(double value);

0 commit comments

Comments
 (0)