In JavaScript doing a simple shipping and handling calculation

前端 未结 6 706
清歌不尽
清歌不尽 2021-01-14 23:39

I am having trouble with a simple JavaScript calculation. My document is supposed to add $1.50 to an order if it is $25 or less, or add 10% of the order if it is more then $

6条回答
  •  梦毁少年i
    2021-01-15 00:07

    Actually, you need to cast your text results into float values using parseFloat()

    http://www.w3schools.com/jsref/jsref_parseFloat.asp

提交回复
热议问题