Skip to content

Commit

Permalink
No decimals for pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Aug 5, 2022
1 parent b7d0710 commit c75ef8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/uorocketry/basestation/data/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class Data {
private Types type;

private DecimalFormat format = new DecimalFormat("#.######");

private DecimalFormat noDecimals = new DecimalFormat("#");

enum Types {
NORMAL,
LONG,
Expand Down Expand Up @@ -73,8 +74,8 @@ public String getFormattedString() {
return dataLong != null ? format.format(dataLong) : "null";
case PRESSURE:
if (data != null) {
String unitOne = format.format(data);
String unitTwo = format.format(data * 6.895f);
String unitOne = noDecimals.format(data);
String unitTwo = noDecimals.format(data * 6.895f);
return unitOne + " PSI | " + unitTwo + " kPa";
} else {
return "null";
Expand Down

0 comments on commit c75ef8c

Please sign in to comment.