Ignoring zero input

Results 1 to 2 of 2

Thread: Ignoring zero input

  1. #1
    Join Date
    Dec 1969

    Default Ignoring zero input

    hi, this script is supposed to calculate quantity item ordered (from order-form) times its price (in array) as its subPrice.<BR>the problem: it executes all decimals but the zero (and blank).<BR>my question: doesn it happen because of the use of parseInt?<BR>Could you tell me how to solve this problem? thanks<BR>======================================== =======================<BR>if (int parseInt(document.order.elements["quantity"+arr[i]].value)){<BR>subPrice=parseInt(document.order.elem ents["quantity"+arr[i]].value)*price[i];<BR>subPrice=round(subPrice);<BR>document.order.e lements["total"+arr[i]].value="$"+subPrice;<BR> total+=subPrice;<BR>}<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Ignoring zero input

    try parseFloat()<BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts