Skip to content

Commit 3a79ee7

Browse files
committed
proper typing for num_formatter
1 parent d222664 commit 3a79ee7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arraytex/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ def to_matrix(
1717
1818
Args:
1919
arr: the array to be converted
20-
style: a style formatter string, either "b" for "bmatrid" or "p" for "pmatrix"
20+
style: a style formatter string, either "b" for "bmatrix" or "p" for "pmatrix"
2121
num_format: a number formatter string, e.g. ".2f"
2222
2323
Returns:
2424
the string representation of the array
2525
"""
2626

27-
def num_formatter(x: Union[int, float]) -> str:
27+
def num_formatter(x: Union[np.int64, np.float64, np.float32]) -> str:
2828
return f"%{num_format}" % x
2929

3030
environment = f"{style}matrix"

0 commit comments

Comments
 (0)