Merge pull request #27440 from hashicorp/alisdair/fix-rendering-of-long-integers
cli: Fix rendering of long integers
This commit is contained in:
commit
f5785b43c2
|
@ -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"
|
||||
|
|
|
@ -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`,
|
||||
|
|
Loading…
Reference in New Issue