diff options
author | Alexandre Flament <alex@al-f.net> | 2022-11-05 22:46:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 22:46:50 +0100 |
commit | 4fe54636710288000e851d9c2d8879f40f6572f7 (patch) | |
tree | 60fc272d6c90b0dee7455d61958481426569849c /searx | |
parent | e9f42e1c22fa93f97c9ed56b4942462d4e8a8d5d (diff) | |
parent | 947b62c9d5aad8bca5451c406ae0945c02d577ae (diff) | |
download | searxng-4fe54636710288000e851d9c2d8879f40f6572f7.tar.gz searxng-4fe54636710288000e851d9c2d8879f40f6572f7.zip |
Merge pull request #1869 from vgerak/1836-ddg-weather
Fix floating point format in DDG weather humidity
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/duckduckgo_weather.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/duckduckgo_weather.py b/searx/engines/duckduckgo_weather.py index d0f34d60f..0540cbcb5 100644 --- a/searx/engines/duckduckgo_weather.py +++ b/searx/engines/duckduckgo_weather.py @@ -39,12 +39,12 @@ def generate_condition_table(condition): res += ( f"<tr><td>{gettext('Wind')}</td><td>{condition['windBearing']}° — " - f"{'%.2f' % (condition['windSpeed'] * 1.6093440006147)} km/h / {condition['windSpeed']} mph</td></tr>" + f"{(condition['windSpeed'] * 1.6093440006147):.2f} km/h / {condition['windSpeed']} mph</td></tr>" ) res += f"<tr><td>{gettext('Visibility')}</td><td>{condition['visibility']} km</td>" - res += f"<tr><td>{gettext('Humidity')}</td><td>{condition['humidity'] * 100}%</td></tr>" + res += f"<tr><td>{gettext('Humidity')}</td><td>{(condition['humidity'] * 100):.1f}%</td></tr>" return res |