kubo/test/cli/testutils/floats.go
Marcin Rataj 6a008fc74c
refactor: apply go fix modernizers from Go 1.26 (#11190)
* chore: apply go fix modernizers from Go 1.26

automated refactoring: interface{} to any, slices.Contains,
and other idiomatic updates.

* feat(ci): add `go fix` check to Go analysis workflow

ensures Go 1.26 modernizers are applied, fails CI if `go fix ./...`
produces any changes (similar to existing `go fmt` enforcement)
2026-02-11 01:01:32 +01:00

10 lines
178 B
Go

package testutils
func FloatTruncate(value float64, decimalPlaces int) float64 {
pow := 1.0
for range decimalPlaces {
pow *= 10.0
}
return float64(int(value*pow)) / pow
}