You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/src/Outlander/Scripting/FunctionEvaluator.swift
+33-3Lines changed: 33 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,36 @@ class FunctionExecutor {
255
255
256
256
return"false"
257
257
},
258
+
.function("max", arity:2):{ args in
259
+
guardlet numA =Double(args[0].trimmingCharacters(in:.whitespacesAndNewlines)),let numB =Double(args[1].trimmingCharacters(in:.whitespacesAndNewlines))else{
260
+
return""
261
+
}
262
+
263
+
letresult= numA > numB ? numA : numB
264
+
265
+
varres="\(result)"
266
+
267
+
if result ==rint(result){
268
+
res ="\(Int(result))"
269
+
}
270
+
271
+
return res
272
+
},
273
+
.function("min", arity:2):{ args in
274
+
guardlet numA =Double(args[0].trimmingCharacters(in:.whitespacesAndNewlines)),let numB =Double(args[1].trimmingCharacters(in:.whitespacesAndNewlines))else{
0 commit comments