Jump to content

Smarty Tags and prices


marketinggpt

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated