Skip to content

Commit e7a5a91

Browse files
author
KrishnaSai2020
committed
doctest fix for #42670
1 parent cc55377 commit e7a5a91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/io/formats/format.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ def __init__(self, accuracy: int | None = None, use_eng_prefix: bool = False):
19521952
self.accuracy = accuracy
19531953
self.use_eng_prefix = use_eng_prefix
19541954

1955-
def __call__(self, num: int | float) -> str:
1955+
def __call__(self, num: int | float) -> int:
19561956
"""
19571957
Formats a number in engineering notation, appending a letter
19581958
representing the power of 1000 of the original number. Some examples:
@@ -1983,6 +1983,9 @@ def __call__(self, num: int | float) -> str:
19831983
return "inf"
19841984

19851985
sign = 1
1986+
if dnum == 0:
1987+
formatted = 0
1988+
return formatted
19861989

19871990
if dnum < 0: # pragma: no cover
19881991
sign = -1

0 commit comments

Comments
 (0)