diff --git a/lib/gensens.pm b/lib/gensens.pm index 1c7cf14..b9e17d0 100644 --- a/lib/gensens.pm +++ b/lib/gensens.pm @@ -153,9 +153,7 @@ sub gensens_update { $val = ; $val = trim($val); $unit = $gensens->{unit}->{$str} || 0; - $c = () = $unit =~ /0/g; - $val /= 10**$c if $unit > 1; - $val *= 10**$c if $unit > 0 && $unit < 1; + $val /= $unit if $unit != 0; close(IN); } else { logger("$myself: ERROR: unable to open '$gensens->{desc}->{$str}'.");