Hi all,

I've been playing about with a story generator using javascript and need to convert some numbers into words and perform some basic operations like multiplication and division within the document.write. The conversion to words is what has been giving me major problems.

I found this code for converting numbers to words but am at a complete loss as to how to implement it within document write...

a small example of how it's being used:

address1=prompt("House number (numeric)","");

document.write(" <a>"+name+"</a> didn't answer, not recognising the voice outside and silently waited. After <a>"+address1+"</a> minutes footsteps dragged themselves away from the door and the steady roar of a car on it's last legs could be heard starting up and slowly fading into the distance. ");
where address1 is the number and i need to be able to both turn into words and perform basic operations on it. Clearly I'm not the most advanced in javascript.

Completely stuck! So any help would be amazing!