wttr.in icon indicating copy to clipboard operation
wttr.in copied to clipboard

Only show sign when temperature is negative.

Open simurgh9 opened this issue 3 years ago • 1 comments

curl 'wttr.in/?format=%t\n&m' returns, e. g., +10°C. I want it to be just 10°C unless the temperature is bellow zero. So -10°C should have a sign while positive should not. Is this possible? Also, for curl 'wttr.in/?format=%s\n&m', is there a way to not get seconds? E. g., hh:mm:ss should be hh:mm without messing with the system's localisation settings.

simurgh9 avatar Dec 09 '22 01:12 simurgh9

curl -s 'wttr.in/?format=%t\n&m' | tr -d +

Removes the + from the output:

$ curl -s 'wttr.in/?format=%t\n&m' | tr -d + > 5°C

Hope this helps

obehrens avatar Feb 15 '23 20:02 obehrens