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())
|
return strconv.Quote(v.AsString())
|
||||||
case cty.Number:
|
case cty.Number:
|
||||||
bf := v.AsBigFloat()
|
bf := v.AsBigFloat()
|
||||||
return bf.Text('g', -1)
|
return bf.Text('f', -1)
|
||||||
case cty.Bool:
|
case cty.Bool:
|
||||||
if v.True() {
|
if v.True() {
|
||||||
return "true"
|
return "true"
|
||||||
|
|
|
@ -89,10 +89,22 @@ EOT_`,
|
||||||
cty.NumberIntVal(5),
|
cty.NumberIntVal(5),
|
||||||
`5`,
|
`5`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cty.NumberIntVal(1234567890),
|
||||||
|
`1234567890`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
cty.NumberFloatVal(5.2),
|
cty.NumberFloatVal(5.2),
|
||||||
`5.2`,
|
`5.2`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cty.NumberFloatVal(123456789.0),
|
||||||
|
`123456789`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
cty.NumberFloatVal(123456789.01),
|
||||||
|
`123456789.01`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
cty.False,
|
cty.False,
|
||||||
`false`,
|
`false`,
|
||||||
|
|
Loading…
Reference in New Issue