From 5fe71cfcd1b6d48e8317d7a735e506f9584a5d0a Mon Sep 17 00:00:00 2001 From: andi291 <> Date: Fri, 10 Jun 2016 14:43:04 +0000 Subject: [PATCH] 10_KNX.pm: changed sprintf for int-dpt from %d to %.0f git-svn-id: https://svn.fhem.de/fhem/trunk@11643 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_KNX.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fhem/FHEM/10_KNX.pm b/fhem/FHEM/10_KNX.pm index 7b4573df1..e4e990d25 100644 --- a/fhem/FHEM/10_KNX.pm +++ b/fhem/FHEM/10_KNX.pm @@ -14,6 +14,7 @@ # ABU 20160422 Added dpt9.021 - mA # ABU 20160529 Changed Doku # ABU 20160605 Changed Doku, changed autocreate-naming, fixed dpt10-sending-now +# ABU 20160608 changed sprintf for int-dpt from %d to %.0f package main; @@ -1282,7 +1283,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #1-Octet unsigned value elsif ($code eq "dpt5") @@ -1294,7 +1295,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #1-Octet signed value elsif ($code eq "dpt6") @@ -1307,7 +1308,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #2-Octet unsigned Value elsif ($code eq "dpt7") @@ -1319,7 +1320,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #2-Octet signed Value elsif ($code eq "dpt8") @@ -1332,7 +1333,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #2-Octet Float value elsif ($code eq "dpt9") @@ -1384,7 +1385,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #4-Octet Signed Value elsif ($code eq "dpt13") @@ -1397,7 +1398,7 @@ decodeByDpt ($$$) { $state -= $offset if (defined ($offset)); $state *= $factor if (defined ($factor)); - $state = sprintf ("%d", $state); + $state = sprintf ("%.0f", $state); } #4-Octet single precision float elsif ($code eq "dpt14")