diff --git a/repl/format.go b/repl/format.go index d62622df6..14e09d708 100644 --- a/repl/format.go +++ b/repl/format.go @@ -52,7 +52,7 @@ func FormatValue(v cty.Value, indent int) string { return strconv.Quote(v.AsString()) case cty.Number: bf := v.AsBigFloat() - return bf.Text('g', -1) + return bf.Text('f', -1) case cty.Bool: if v.True() { return "true" diff --git a/repl/format_test.go b/repl/format_test.go index d0b6b8805..6d4e484bd 100644 --- a/repl/format_test.go +++ b/repl/format_test.go @@ -89,10 +89,22 @@ EOT_`, cty.NumberIntVal(5), `5`, }, + { + cty.NumberIntVal(1234567890), + `1234567890`, + }, { cty.NumberFloatVal(5.2), `5.2`, }, + { + cty.NumberFloatVal(123456789.0), + `123456789`, + }, + { + cty.NumberFloatVal(123456789.01), + `123456789.01`, + }, { cty.False, `false`,