1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 02:40:11 +01:00

Fix floating point format in DDG weather humidity

Fixes #1836
This commit is contained in:
Vasilis Gerakaris 2022-10-20 00:09:14 +03:00 committed by Vasilis Gerakaris
parent 1a5b096578
commit 947b62c9d5
No known key found for this signature in database
GPG Key ID: 1A67CF8FBC6FC5FD

View File

@ -39,12 +39,12 @@ def generate_condition_table(condition):
res += ( res += (
f"<tr><td>{gettext('Wind')}</td><td>{condition['windBearing']}° — " 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('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 return res