From 1e6f757daf04d3496279fd13ba662712a90cbf87 Mon Sep 17 00:00:00 2001 From: jan-ccd <51994019+jan-ccd@users.noreply.github.com> Date: Mon, 22 Jun 2020 01:05:03 +0200 Subject: [PATCH] NumericField: cast number_format param to float This will help to avoid an ErrorException: number_format() expects parameter 1 to be float, string given --- src/field/NumericField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/NumericField.php b/src/field/NumericField.php index de679d3..ddde0d5 100644 --- a/src/field/NumericField.php +++ b/src/field/NumericField.php @@ -44,7 +44,7 @@ public function fromData($data) { if (!$this->getDecimalCount()) { return (integer)substr($data, 0, $this->getLength()); } else { - return (float)number_format(substr($data, 0, $this->getLength()), $this->getDecimalCount(), '.', ''); + return (float)number_format((float)substr($data, 0, $this->getLength()), $this->getDecimalCount(), '.', ''); } }