1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-06 17:40:58 +00:00

Fix float formatting (#2018)

Format floats the same way as actions/runner (precision 15, remove
trailing zeroes)

See: 67d70803a9/src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/NumberToken.cs (L34)
This commit is contained in:
Jon Jensen 2023-10-13 14:01:04 -06:00 committed by GitHub
parent 02aa47db9e
commit 82d61eaf05
2 changed files with 2 additions and 1 deletions

View file

@ -447,7 +447,7 @@ func (impl *interperterImpl) coerceToString(value reflect.Value) reflect.Value {
} else if math.IsInf(value.Float(), -1) {
return reflect.ValueOf("-Infinity")
}
return reflect.ValueOf(fmt.Sprint(value))
return reflect.ValueOf(fmt.Sprintf("%.15G", value.Float()))
case reflect.Slice:
return reflect.ValueOf("Array")