זה לא קוד מושלם ועובד
אבל לענ"ד אמור לתת כיון טוב
var theSum = '1245'
var theSumToWords = ''
var someWords = ['אחד','שתים','שלוש','ארבע','חמש','שש','שבע','שמונה','תישע']
var greatWords = ['','מאות','עשרה ','ת אלפים',]
var hcflr = 1
for ( var i = 0; i < theSum.length; i++ ) {
var modul = theSum % hcflr
hcflr *= 10
theSumToWords = someWords[modul] + greatWords[i] + theSumToWords
}
פורסם במקור בפורום CODE613 ב18/10/2015 01:06 (+03:00)