mbox

[bug#42208,0/1] weather: Print 0.0% correctly.

Message ID 20200704230504.6763-1-arunisaac@systemreboot.net
Headers show

Message

Arun Isaac July 4, 2020, 11:05 p.m. UTC
This is a bit of a nitpick. When there are no substitues, `guix weather`
reports it as ".0% substitutes available". It should instead report it as
"0.0% substitutes unavailable". I didn't know what the '2' specifying width in
~2,1f was for. Hence, I have removed it. Feel free to correct me if I did
something wrong.

Arun Isaac (1):
  weather: Print 0.0% correctly.

 guix/scripts/weather.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathieu Othacehe July 5, 2020, 7:54 a.m. UTC | #1
Hello Arun,

> "0.0% substitutes unavailable". I didn't know what the '2' specifying width in
> ~2,1f was for. Hence, I have removed it. Feel free to correct me if I did
> something wrong.

This "2" is the width argument of the ~f parameter (see
https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html).

It's supposed to pad left with spaces if the output is less than "2"
characters. Anyway, the zero case is not handled properly as you
noticed, so this looks good to me.

Thanks,

Mathieu