Skip to content

Commit

Permalink
Changing output of 'getRationalNumberValue' from float to double
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneFuture committed Feb 18, 2024
1 parent 0ad1a95 commit 29f8a93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.redstoneworld.redutilities</groupId>
<artifactId>redutilities</artifactId>
<version>0.0.11-Snapshot</version>
<version>0.0.12-Snapshot</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/de/redstoneworld/redutilities/misc/Formatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public static String getTimeString(long timestamp, String format) {

/**
* This method reforms the rational number spelling and convert it
* to a float number. Flexible inputs are allowed, which improves
* to a double number. Flexible inputs are allowed, which improves
* the usability.
*
* @param cmdInput the rational number with one of all supported spellings
* @return (float) the formatted rational number (decimal value)
* @return (double) the formatted rational number (decimal value)
*/
public static float getRationalNumberValue(String cmdInput) {
public static double getRationalNumberValue(String cmdInput) {

// replace decimal separator of DE
cmdInput = cmdInput.replace(",", ".");
Expand All @@ -50,8 +50,8 @@ public static float getRationalNumberValue(String cmdInput) {
cmdInput = cmdInput.replace(".", "0.");
}

// convert the string to a float number
return Float.parseFloat(cmdInput);
// convert the string to a double number
return Double.parseDouble(cmdInput);
}

/**
Expand Down

0 comments on commit 29f8a93

Please sign in to comment.