Skip to content

Commit 5b5ccd2

Browse files
committed
fix docstring + add type hint
1 parent 00c1290 commit 5b5ccd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

causalpy/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def _format_sig_figs(value, default=None):
6767
return max(int(np.log10(np.abs(value))) + 1, default)
6868

6969

70-
def convert_to_string(x: Union[float, xr.DataArray], round_to=2) -> str:
71-
"""Utility function which takes in nunmeric inputs and returns a string."""
70+
def convert_to_string(x: Union[float, xr.DataArray], round_to: int = 2) -> str:
71+
"""Utility function which takes in numeric inputs and returns a string."""
7272
if isinstance(x, float):
7373
# In the case of a float, we return the number rounded to 2 decimal places
7474
return f"{x:.2f}"

0 commit comments

Comments
 (0)