Convert numbers in words

خرید بک لینک

the code below is converting the number and only whole numbers into words. How to convert the whole numbers as well as the decimals as well into words? Thank you!

function update(){ var bigNumArry = new Array('', ' thousand', ' million', ' billion', ' trillion', ' quadrillion', ' quintillion'); var output = ''; var numString = document.getElementById('number').value; var finlOutPut = new Array(); if (numString == '0') { document.getElementById('container').innerHTML = 'Zero'; retu; } if (numString == 0) { document.getElementById('container').innerHTML = 'messeg tell to enter numbers'; retu; } var i = numString.length; i = i - 1; //cut the number to grups of three digits and add them to the Arry while (numString.length > 3) { var triDig = new Array(3); triDig[2] = numString.charAt(numString.length - 1); triDig[1] = numString.charAt(numString.length - 2); triDig[0] = numString.charAt(numString.length - 3); var varToAdd = triDig[0] + triDig[1] + triDig[2]; finlOutPut.push(varToAdd); i--; numString = numString.substring(0, numString.length - 3); } finlOutPut.push(numString); finlOutPut.reverse(); //conver each grup of three digits to english word //if all digits are zero the triConvert //function retu the string "dontAddBigSufix" for (j = 0; j = 0; b--) { if (finlOutPut[b] != "dontAddBigSufix") { finlOutPut[b] = finlOutPut[b] + bigNumArry[bigScalCntr]; //

this code prevent non numeric letters/ onkeydown="retu (event.ctrlKey || event.altKey || (4734 && event.keyCode<40) || (event.keyCode==46) )"/>

Here The Numbers Printed

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 181 تاريخ: چهارشنبه 5 خرداد 1395 ساعت: 22:22

صفحه بندی