There is a rule to it. If it's a number between 1 to 10, you can spell it, but if it's more than 10, it's advised that you spell the number.