Skip to content

Commit

Permalink
Typo fix in json_server that removes trailing zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
hollie committed Dec 1, 2015
1 parent 4e20e7e commit 0d3143f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/json_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ sub json_get {
$value1 = ($value1 - 32) * (5/9) if (($celsius) and (lc $type[$index] eq "temperature"));
$value1 = sprintf("%." . $round[$index] . "f",$value1) if (defined $round[$index]);
#print "value1=$value1";
$value1 =~ s/\.?0*$// unless ($value1 == 0); #remove unneccessary trailing decimals
$value1 =~ s/\.0*$// unless ($value1 == 0); #remove unneccessary trailing decimals
$value1 = "null" if (lc $value1 eq "nan");
#print "value1=$value1\n";
#my @array = ();
Expand Down

0 comments on commit 0d3143f

Please sign in to comment.