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:
parent
02aa47db9e
commit
82d61eaf05
2 changed files with 2 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue