Skip to content

Commit fad0bab

Browse files
author
KrishnaSai2020
committed
doctest fix for #42670
1 parent 170cc45 commit fad0bab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/io/formats/format.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1952,13 +1952,13 @@ 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) -> int:
1955+
def __call__(self, num: int | float) ->str:
19561956
"""
19571957
Formats a number in engineering notation, appending a letter
19581958
representing the power of 1000 of the original number. Some examples:
19591959
>>> format_eng = EngFormatter()
19601960
>>> format_eng(0) # for self.accuracy = 0
1961-
'0'
1961+
' 0'
19621962
19631963
>>> format_eng(1000000) # for self.accuracy = 1,
19641964
# self.use_eng_prefix = True
@@ -1984,7 +1984,7 @@ def __call__(self, num: int | float) -> int:
19841984

19851985
sign = 1
19861986
if dnum == 0:
1987-
formatted = 0
1987+
formatted = ' 0'
19881988
return formatted
19891989

19901990
if dnum < 0: # pragma: no cover

0 commit comments

Comments
 (0)