marketinggpt Posted October 25, 2009 Share Posted October 25, 2009 hello, I have a commission javascript which i want to incorporate smarty tags into. but the problem im having is the prices always have $ and USD at the end like $4.99 USD the script im using can only have numbers with decimals 4.99 is there anyway i can use smarty tags where they do not include the $ and USD and just have the price numbers? or can someone tell me how i can include the $ and USD in the script and still calculate a total <SCRIPT LANGUAGE="JavaScript"> function a_times_b(form) { a=eval(form.a.value) b=eval(form.b.value) if (isNaN(b) == true) {b = "0"; } if (b > "20") {c = ".25"; } else if (b > "10") { c = ".25"; } else if (b > "0") { c = ".25"; } else { c = "0"; } d=a*b*c form.ans.value= "$" + d.toFixed(2) } </SCRIPT> thanks Justin 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.