Welcome, Guest
  • Page:
  • 1

TOPIC: Decimalizing a number

Decimalizing a number 1 year, 8 months ago #16791

I have a drop down field giving a numerical vale, and am multiplying that by a hidden field with a constant and am displaying it in a 3rd field (total price). That's all working fine.

However, the result is just a non-currency result - 40, 80, 120... how do I make it display as currency? Having both the currency symbol and 2 decimal places is perfect, just the 2 decimal places is acceptable.

I am using this code to get to this point -

1st field

function ff_num1_action(element,action) {
ff_myanswer_action(element,action);
}

2nd field

function ff_num2_action(element,action) {
ff_myanswer_action(element,action);
}

Total field

function ff_myanswer_action(element,action)
{
ff_getElementByName('myanswer').value = 0;
if (ff_getElementByName('num1').value)
{
ff_getElementByName('myanswer').value =
Number(ff_getElementByName('num1').value) *
Number(ff_getElementByName('num2').value);
}
}

THEN... I want to pass this field value to a PayPal button. I had originally done the form is QuickMode but the field placement and size controls are far too limited so will have to rewrite in ClassicMode. I need some guidance on that too please.
  • trogladyte
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
Last Edit: 1 year, 8 months ago by trogladyte.
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.23 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint