Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca8044c

Browse files
authored
Update round fix (#19260)
* Update round fix On webpage `int(pct/100.*np.sum(allvals))` cause a wrong round and absolute number representation. Here `int(round(foo))` make a not needed `int(foo)` conversion. Remove the `int(foo)`. * Use `numpy` round
1 parent dcffef7 commit ca8044c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/pie_and_polar_charts/pie_and_donut_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
def func(pct, allvals):
46-
absolute = int(round(pct/100.*np.sum(allvals)))
46+
absolute = int(np.round(pct/100.*np.sum(allvals)))
4747
return "{:.1f}%\n({:d} g)".format(pct, absolute)
4848

4949

0 commit comments

Comments
 (0)