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

Plugins/Weather: Show temps in C/F instead of F/C

This commit is contained in:
Pragmatic Software 2020-04-28 14:54:36 -07:00
parent 7412ce29c2
commit d290fe1819

View File

@ -115,7 +115,7 @@ sub get_weather {
sub fix_temps {
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); "${c}C/${f}F"|eg;
return $text;
}