12345731 in words is written as :

Twelve Million Thousand Seven Hundred and Thirty One