You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
557 B
Lua

local tonumber = tonumber
return function()
return {
messages = {
affirmative = {
standard = "{{placeholder}} must be positive"
},
negative = {
standard = "{{placeholder}} cannot be positive"
}
},
apply = function(context)
local number = tonumber(context.input)
if not number then
context.result = false
return
end
context.result = (number > 0)
end
}
end