Pergunta de entrevista da empresa FINEXUS Group

They asked me to write a function that converts a number into its word representation. For example, converting 120981 into "one hundred twenty thousand nine hundred and eighty one".