Skip to content

Commit

Permalink
Fixed #620
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinhard-Pilz-Dynatrace committed Dec 20, 2024
1 parent 04bc55f commit fce30b4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dynatrace/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import (
"encoding/binary"
"encoding/json"
"fmt"
"math"
"math/big"
"reflect"
"strconv"
"strings"

"github.com/dynatrace-oss/terraform-provider-dynatrace/terraform/hcl"
Expand Down Expand Up @@ -187,7 +189,17 @@ var LegacyLongDecode = func(id string) string {
if err != nil {
return err.Error()
}
return fmt.Sprintf("%v", result)
finalResult := fmt.Sprintf("%v", result)
num, err := strconv.Atoi(finalResult)
if err != nil {
return finalResult
}

absoluteValue := int(math.Abs(float64(num)))
if absoluteValue < 1000 {
return ""
}
return finalResult
}

func SetLegacyID(id string, converter func(string) string, v any) {
Expand Down

0 comments on commit fce30b4

Please sign in to comment.