String.format number expected, got string

print(string.format("Why did %s %d?", "the chicken", "cross the road"))

Output says

print(string.format(“Why did %s %d?”, “the chicken”, “cross the road”)):1: invalid argument #3 to ‘format’ (number expected, got string)
This doesn’t make any sense at all. Why does it expect a number? Its a string

You used %d instead of %s, so it is expecting a number.
image

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.