Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Fix handling non-numeric values from the 'Unité' template #1288

Closed
BoboTiG opened this issue May 11, 2022 · 0 comments · Fixed by #1293
Closed

[FR] Fix handling non-numeric values from the 'Unité' template #1288

BoboTiG opened this issue May 11, 2022 · 0 comments · Fixed by #1293
Assignees
Labels
bug Something isn't working locale:French

Comments

@BoboTiG
Copy link
Owner

BoboTiG commented May 11, 2022

Wikicode:

{{Unité|8 à 12|cm}}

Output:

  File "lang/fr/template_handlers.py", line 966, in render_unite
    phrase = number(parts.pop(0), float_separator, thousands_separator)
  File "user_functions.py", line 354, in number
    res = f"{float(number):,}"
ValueError: could not convert string to float: '8à12'

Expected:

8 à 12 cm

Model link, if any: https://fr.wiktionary.org/wiki/Mod%C3%A8le:Unit%C3%A9

@BoboTiG BoboTiG added bug Something isn't working locale:French labels May 11, 2022
@BoboTiG BoboTiG changed the title [FR] Handle non-integer values from 'Unité' template [FR] Fix handling non-integer values from the 'Unité' template May 11, 2022
@BoboTiG BoboTiG changed the title [FR] Fix handling non-integer values from the 'Unité' template [FR] Fix handling non-numeric values from the 'Unité' template May 11, 2022
@BoboTiG BoboTiG self-assigned this May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working locale:French
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant