How to display the numbers inputed in a text field?
By : user45547
Date : March 29 2020, 07:55 AM
should help you out I am creating a form with one field to input numbers . How can I show the value of the numbers in text format in the below text field ? , here you are code :
function readable_number(num){
var bits_a = ["thousand", "million", "billion", "trillion", "zillion"];
var bits_b = ["ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"];
var bits_c = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"];
if (num==0){return 'zero';}
var result = (num<0)?'minus ':'';
num = Math.abs(num);
for(var i=bits_a.lenght; i>0; i){
var p = pow(1000, i);
if (num > p){
var b = Math.floor(num/p);
num = p * b;
result += readable_number(b) + ' ' + bits_a[i1];
result += ((num)?', ':'');
}
}
if (num > 100){
var b = Math.floor(num/100);
num = 100 * b;
result += readable_number(b) + ' hundred' + ((num)?' and ':' ');
}
if (num >= 20){
var b = Math.floor(num/10);
num = 10 * b;
result += bits_b[b1] + ' ';
}
if (num){
result += bits_c[num1];
}
return result;
}
alert(readable_number(1234));

calculate inputed numbers from textboxes
By : Warattaya Hooya
Date : March 29 2020, 07:55 AM
like below fixes the issue My mission to my program is when a record filtered in the textboxes if i change the numbers it will automatically change the total and calculate in the (total)textbox...can anyone help me whats wrong with my code? I porposely dont loop the textboxes because i have plans on it. , use this on onchange event code :
function optTotal() {
var a1 = document.forms[0].optA;
var b1 = document.forms[0].optB;
var c1 = document.forms[0].optC;
var d1 = document.forms[0].optD;
if (a1.value && a1.value != "")
a1 = parseFloat(a1.value);
else
a1 = 0;
if (b1.value && b1.value != "")
b1 = parseFloat(b1.value);
else
b1 = 0;
if (c1.value && c1.value != "")
c1 = parseFloat(c1.value);
else
c1 = 0;
if (d1.value && d1.value != "")
d1 = parseFloat(d1.value);
else
d1 = 0;
var total = a1 + b1 + c1+d1;
document.forms[0].total.value = total;
}

How to add inputed numbers in string.(Python)
By : Sumathi Kotthuri
Date : March 29 2020, 07:55 AM

using array print numbers inputed by user ignore duplicate numbers
By : dieler
Date : March 29 2020, 07:55 AM

how do I find the max of inputed numbers
By : Katie McAuliffe
Date : March 29 2020, 07:55 AM

