types: fix number() call

This commit is contained in:
c9s 2023-06-19 14:51:37 +08:00
parent 2448fa6f83
commit 759dce1d5a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -13,6 +13,11 @@ func number(v interface{}) fixedpoint.Value {
case float64:
return fixedpoint.NewFromFloat(tv)
case int64:
return fixedpoint.NewFromInt(tv)
case int:
return fixedpoint.NewFromInt(int64(tv))
case string:
return fixedpoint.MustNewFromString(tv)