How to make guard better?

I already try to find out solution base on your clue since this morning, still can’t find it. stuck when to find out how to check is_integer with return {:ok, result}, I thinks this links Is there a better way to handle :ok tuples? is similar issue, but i still can’t solve this. Can you give other clue or directly sample code ? Thx