Skip to content

Commit

Permalink
Merge pull request #567 from hollie/json_server_regexp_fix
Browse files Browse the repository at this point in the history
Typo fix in json_server that removes trailing zeros
  • Loading branch information
hplato committed Dec 2, 2015
2 parents 4e20e7e + 0d3143f commit e972923
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 e972923

Please sign in to comment.