diff options
author | Andinus <andinus@nand.sh> | 2020-06-08 18:26:45 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-06-08 18:26:45 +0530 |
commit | b4e3aa288325e8541caaa30b53c9e6ced25273a4 (patch) | |
tree | ad44027b325a862d2b1e30973b6a55a49860b433 | |
parent | dd3aa452e9d114ed12ba6c05ff5feec55765914c (diff) | |
download | ara-b4e3aa288325e8541caaa30b53c9e6ced25273a4.tar.gz |
Don't add '+' to deltaconfirmed if it's a negative number
"State Unassigned" had deltaconfirmed of -773 today which showed up as "+-773".
-rwxr-xr-x | ara.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ara.pl b/ara.pl index 1c28fe9..963720d 100755 --- a/ara.pl +++ b/ara.pl @@ -180,7 +180,12 @@ foreach my $i ( 0 ... $rows_to_print - 1 ) { # Add delta only if it was updated Today. if ( $update_info eq "Today" ) { - $confirmed .= " (+$statewise->[$i]{deltaconfirmed})"; + if ( $statewise->[$i]{deltaconfirmed} >= 0 ) { + $confirmed .= " (+$statewise->[$i]{deltaconfirmed})"; + } else { + $confirmed .= " ($statewise->[$i]{deltaconfirmed})"; + } + $recovered .= " (+$statewise->[$i]{deltarecovered})"; $deaths .= " (+$statewise->[$i]{deltadeaths})"; } |