Skip to content

Commit bce2b6f

Browse files
committed
Better formatting for __str__
1 parent 898531f commit bce2b6f

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/floats

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/floats/FloatBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static double asDouble(boolean right) {
114114
abstract static class StrNode extends PythonUnaryBuiltinNode {
115115
@Specialization
116116
String str(double self) {
117-
InternalFormat.Spec spec = new InternalFormat.Spec(' ', '>', InternalFormat.Spec.NONE, false, InternalFormat.Spec.UNSPECIFIED, false, 16, 'g');
117+
InternalFormat.Spec spec = new InternalFormat.Spec(' ', '>', InternalFormat.Spec.NONE, false, InternalFormat.Spec.UNSPECIFIED, false, 0, 'r');
118118
FloatFormatter f = new FloatFormatter(getCore(), spec);
119119
f.setMinFracDigits(1);
120120
String result = f.format(self).getResult();

0 commit comments

Comments
 (0)