From bba75aa1669813b2be4db4d201c72efb13ab698f Mon Sep 17 00:00:00 2001
From: Arturo Gonzalez <arturo.gonzalez@artica.es>
Date: Thu, 1 Dec 2016 08:55:44 +0100
Subject: [PATCH] Now non decimal numbers have all right zeros. Ticket #4254

---
 pandora_console/include/functions.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php
index 9085a036a7..0b0ceb11d7 100644
--- a/pandora_console/include/functions.php
+++ b/pandora_console/include/functions.php
@@ -2664,7 +2664,13 @@ function pandora_setlocale() {
 }
 
 function remove_right_zeros ($value) {
-	$value_to_return = rtrim($value, "0");
-	return rtrim($value_to_return, ".");
+	$is_decimal = explode(".", $value);
+	if (isset($is_decimal[1])) {
+		$value_to_return = rtrim($value, "0");
+		return rtrim($value_to_return, ".");
+	}
+	else {
+		return $value;
+	}
 }
 ?>