Bug fix format_wikibase_time centuries
This commit is contained in:
parent
13ecf4526d
commit
a04106ce1f
|
@ -204,7 +204,7 @@ def format_wikibase_time(v: WikibaseTime) -> str | None:
|
||||||
case 7: # century
|
case 7: # century
|
||||||
century = ((int(t[:5]) - 1) // 100) + 1
|
century = ((int(t[:5]) - 1) // 100) + 1
|
||||||
ordinal_num = num2words(abs(century), to="ordinal_num")
|
ordinal_num = num2words(abs(century), to="ordinal_num")
|
||||||
return f"{ordinal_num} {century}{' BC' if century < 0 else ''}"
|
return f"{ordinal_num} century{' BC' if century < 0 else ''}"
|
||||||
case 6: # millennium
|
case 6: # millennium
|
||||||
millennium = ((int(t[:5]) - 1) // 1000) + 1
|
millennium = ((int(t[:5]) - 1) // 1000) + 1
|
||||||
ordinal_num = num2words(abs(millennium), to="ordinal_num")
|
ordinal_num = num2words(abs(millennium), to="ordinal_num")
|
||||||
|
|
Loading…
Reference in a new issue