From 29f8a93995cbbf16a8a3954b09089a4baae5bf94 Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Sun, 18 Feb 2024 21:43:01 +0100 Subject: [PATCH] Changing output of 'getRationalNumberValue' from float to double --- pom.xml | 2 +- .../de/redstoneworld/redutilities/misc/Formatter.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b39be12..64a21a7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.redstoneworld.redutilities redutilities - 0.0.11-Snapshot + 0.0.12-Snapshot UTF-8 diff --git a/src/main/java/de/redstoneworld/redutilities/misc/Formatter.java b/src/main/java/de/redstoneworld/redutilities/misc/Formatter.java index 5949fdf..9f93e6f 100644 --- a/src/main/java/de/redstoneworld/redutilities/misc/Formatter.java +++ b/src/main/java/de/redstoneworld/redutilities/misc/Formatter.java @@ -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(",", "."); @@ -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); } /**