Multiple a time with a number using javascript -
can code. multiply number such 20 time e.g. 35:00. need work out total cost per employee based on how have worked week. have multiplied 2 fields containing these values see if works, doesn't. here code
var total = util.printd("timediff") * ("total_cost"); this.getfield("total_cost").value = total;
thank you
you need take time , parse it.
then need calculate each part seperate.
var timearr = util.printd("timediff").split(':'); var total = total_cost; var hours = timearr[0] * total; var minutes = timearr[1] * total; this.getfield("total_cost").value = hours + ':' + minutes;
Comments
Post a Comment