Skip to content

[Bug] cannot store 83.33333333 in float64. (round) #2

@d-costa

Description

@d-costa

I there! First of all thank you for creating this provider @mschuchard 👍 I found it while searching for a round function.

I'm having issues using the round function with calculated values:

Example

terraform {
  required_version = ">= 1.11.0"

  required_providers {
    stdlib = {
      source  = "mschuchard/stdlib"
      version = "~> 2.2.0"
    }
  }
}

locals {
    v = provider::stdlib::round(100 / 3)
}

output "v" {
  value = local.v
}

Steps to reproduce

  • terraform plan

Expected result

33

Actual result

╷
│ Error: Error in function call
│
│   on main.tf line 13, in locals:13:     v = 1, provider::stdlib::round(100 / 3)
│     ├────────────────
│     │ while calling provider::stdlib::round(number)
│
│ Call to function "provider::stdlib::round" failed: Value Conversion Error: An unexpected error was encountered
│ trying to convert to number. This is always an error in the provider. Please report the following to the provider
│ developer:
│
│ cannot store 33.33333333 in float64.

Am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions