Sometimes two numbers will be next to each other in a sentence. When this happens, writing one number in words and one in numerals makes it easier to understand. In general, the convention is to write the shorter number. However, you can sometimes rephrase to avoid this issue.
Correct example: We put five $20 bills on the table.
Correct example: The equipment included 33 six-inch rulers.
Correct example: The equipment included 33 six-inch rulers.
Correct example: Attendance included 512 sixty-year-old women.
Correct example: Attendance included 512 women aged 60.
An exception to this rule is when you have several instances in the same paragraph.