Welcome, Guest

Decimalizing a number
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Decimalizing a number

Decimalizing a number 1 year, 5 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, 5 months ago by trogladyte.
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.27 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany