TOPIC:

calculations with text fields and averages 3 months 3 weeks ago #252878

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5415
  • Karma: 3
  • Thanks: 386
Hi,

for this we should replace comma with point.
Please check this solution:
crosstec.org/en/forums/3-breezingforms-f....html?start=0#242820

If you will have a problem with this, I will assist :)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

calculations with text fields and averages 3 months 2 weeks ago #253144

  • Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 160
  • Thanks: 0
Hi!

It works almost in all items but this one:
function ff_dcrai_action(element, action)
{
ff_getElementByName('dcrai').value = 0;
{
ff_getElementByName('dcrai').value =
Number(ff_getElementByName('rendimentoanualiliquido51').value) +
Number(ff_getElementByName('rai52').value) + 
Number(ff_getElementByName('rai53').value) +
Number(ff_getElementByName('rai54').value) +
Number(ff_getElementByName('rai55').value) +
Number(ff_getElementByName('rai56').value) +
Number(ff_getElementByName('rai57').value) +
Number(ff_getElementByName('rai58').value) +
Number(ff_getElementByName('rai59').value);
}
ff_getElementByName('dcrmi').value=ff_getElementByName('dcrai').value/12;
var result00=ff_getElementByName('dcrai').value;
var result01=result00.toFixed(2);
ff_getElementByName('dcrai').value=result01;
}
// ff_dcrai_action

It doesnt work on self item, please help

Tx in advance

Please Log in or Create an account to join the conversation.

calculations with text fields and averages 3 months 2 weeks ago #253156

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5415
  • Karma: 3
  • Thanks: 386
Hi,

please try like this:
function ff_dcrai_action(element, action)
{
ff_getElementByName('dcrai').value = 0;
{
ff_getElementByName('dcrai').value =
Number(ff_getElementByName('rendimentoanualiliquido51').value) +
Number(ff_getElementByName('rai52').value) + 
Number(ff_getElementByName('rai53').value) +
Number(ff_getElementByName('rai54').value) +
Number(ff_getElementByName('rai55').value) +
Number(ff_getElementByName('rai56').value) +
Number(ff_getElementByName('rai57').value) +
Number(ff_getElementByName('rai58').value) +
Number(ff_getElementByName('rai59').value);
}
ff_getElementByName('dcrmi').value=ff_getElementByName('dcrai').value/12;
var result00=ff_getElementByName('dcrai').value;
var result01=result00.toFixed(2);

var result02=result01.replace(/\,/g, '').replace(/\./g, ','); //this will replace . with ,

ff_getElementByName('dcrai').value=result02;
}
// ff_dcrai_action

Regards,
Tihana

Please Log in or Create an account to join the conversation.

calculations with text fields and averages 3 months 2 weeks ago #253166

  • Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 160
  • Thanks: 0
Hi Tihana!

I'm sorry but I must be doing something wrong.

Not only has 2 decimal places and continues with a dot "."

Its like this: 1234.3456

Target: 1234,35 €

Please help

thanx in advance

Please Log in or Create an account to join the conversation.

Last edit: Post by Luisserafim.

calculations with text fields and averages 3 months 2 weeks ago #253169

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 5415
  • Karma: 3
  • Thanks: 386
Hi,

you should add this code in each field.
Here is an example:

File Attachment:

File Name: example221.zip
File Size:13 KB


Regards,
Tihana
Attachments:

Please Log in or Create an account to join the conversation.

calculations with text fields and averages 3 months 2 weeks ago #253179

  • Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 160
  • Thanks: 0
Hi Tihana!

ok, It works but the real problem is that users imput is with comma like : 123,345 and in this way we recieve NaN variable (Not-A-Number).

In Portugal we always imput 1123123,34 € or 1.234.567,89 €

I know is strange but we discover the world :)

Please help

Thanx in advance


P.S. Maybe we just leave this for last, or no go.

Please Log in or Create an account to join the conversation.

Last edit: Post by Luisserafim.
Time to create page: 0.053 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!