Skip to content

Commit 33144de

Browse files
committed
Fix float display to always show .0 for integer floats (closes #60)
1 parent 7672054 commit 33144de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stdlib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ export function toPythonFloat(num: number): string {
15991599
return num.toExponential().replace(/e([+-])(\d)$/, 'e$10$2');
16001600
}
16011601
if (Number.isInteger(num)) {
1602-
return num.toFixed(1).toString();
1602+
return num.toFixed(1);
16031603
}
16041604
return num.toString();
16051605
}

0 commit comments

Comments
 (0)