Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Not handling floating numbers #188

@j2cagle

Description

@j2cagle

Here are some terraform examples of what triggers the error:
locals { issue1 = 12345 * 0.5 issue2 = floor(429496729.6) }

The error:
RuntimeError: Invalid type to convert to inline HCL: <class 'float'>

Potential fix?:
https://github.com/amplify-education/python-hcl2/blob/main/hcl2/transformer.py#L352

        if isinstance(value, float):
            return str(value)

Workaround:
No found workaround

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions