Solution 1:

It's actually quite unusual to see two times except in a small number of specific contexts...

  • two times two is four (reciting multiplication tables, in which context this chart is interesting)

  • three tablets two times a day (medical prescriptions)

  • the interval between these two times (where "times" is a noun)

  • my salary rose two times last year (ugly, IMHO, but people do say this sometimes)

I can't think offhand of any other usages where twice wouldn't be preferred. The picture is very different with thrice, where the short form is almost archaic, and the longer form is standard.

Solution 2:

I understand why you might be unsure. Even this site gets it wrong, to my mind.

It's a common artefact of computer programs that generate English text by composing numbers and words.