3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 11:42:35 +01:00

Plugins/Weather.pm: fix temps

This commit is contained in:
Pragmatic Software 2020-01-26 06:01:45 -08:00
parent 8c9087c57e
commit 6547acc2f0

View File

@ -115,7 +115,7 @@ sub get_weather {
sub fix_temps { sub fix_temps {
my ($self, $text) = @_; my ($self, $text) = @_;
$text =~ s|(\d+)\s*F|my $f = $1; my $c = ($f - 32 ) * 5 / 9; $c = sprintf("%.1d", $c); "${f}F/${c}C"|eg; $text =~ s|(-?\d+)\s*F|my $f = $1; my $c = ($f - 32 ) * 5 / 9; $c = sprintf("%.1d", $c); "${f}F/${c}C"|eg;
return $text; return $text;
} }