fix 11st to 11th in ordinal
parent
8e238c254e
commit
62eefb9294
|
|
@ -2,6 +2,7 @@ import typer
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from random import randrange
|
from random import randrange
|
||||||
from itertools import product
|
from itertools import product
|
||||||
|
from math import floor
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer()
|
||||||
|
|
||||||
|
|
@ -33,7 +34,10 @@ def export_conv_json(
|
||||||
# ordinal from https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement
|
# ordinal from https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement
|
||||||
|
|
||||||
def ordinal(n):
|
def ordinal(n):
|
||||||
return "%d%s" % (n, "tsnrhtdd"[(n / 10 % 10 != 1) * (n % 10 < 4) * n % 10 :: 4])
|
return "%d%s" % (
|
||||||
|
n,
|
||||||
|
"tsnrhtdd"[(floor(n / 10) % 10 != 1) * (n % 10 < 4) * n % 10 :: 4],
|
||||||
|
)
|
||||||
|
|
||||||
def canon_vars(d, m):
|
def canon_vars(d, m):
|
||||||
return [
|
return [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue