diff --git a/weather.sh b/weather.sh index 48ac49b..af83ddd 100755 --- a/weather.sh +++ b/weather.sh @@ -92,6 +92,10 @@ sub getdir { return "↑"; } +sub c2f { + return ($_[0] * (9/5)) + 32; +} + my @weather = split(":",checksources) or print "Not Available\n\n#FF0000" and exit 33; my $type = $weather[0]; @@ -112,9 +116,9 @@ else {$type=$type."...";} my $loc = substr(($weather[4] or "??????????"), 0, 9); -my $format = '%10.10s - %5.5s  %03dC  %s %03dmph'; -printf( $format, $loc, $type, $temp, $wdir, $wind); +my $format = '%10.10s - %5.5s  %03dF  %s %03dmph'; +printf( $format, $loc, $type, c2f($temp), $wdir, $wind); print "\n"; -printf( $format, $loc, $type, $temp, $wdir, $wind); +printf( $format, $loc, $type, c2f($temp), $wdir, $wind); print "\n"; print $color."\n";