• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: My field calculation only returns whole numbers!

My field calculation only returns whole numbers! 12 years 7 months ago #15063

  • david12
  • david12's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi everybody,

I've successfully created a form which has fields that add themselves and return a value upon clicking the 'calculate' button based on this fantastic example, but I can get it to work only in whole numbers. Is there any way to modify the example given to be able to calculate decimals, e.g. 3.4 + 5.5 = 8.9 ? Thanks in advance,

DM
The administrator has disabled public write access.

Re: My field calculation only returns whole numbers! 12 years 7 months ago #15097

  • webcat-solutions
  • webcat-solutions's Avatar
  • OFFLINE
  • Junior Boarder
  • Dutch Joomla specialist
  • Posts: 29
  • Thank you received: 4
Maybe it's an idea to contact this person? Apparently he was able to use decimals in the output ;-) http://www.rsjoomla.com/forum/37-rsform-pro/15096-trim-result-after-calculation.html
The administrator has disabled public write access.

Re: My field calculation only returns whole numbers! 12 years 7 months ago #15113

  • CalenxarJake
  • CalenxarJake's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 4
It is always helpful to put your code up for people to look at. It will get you quicker fixes.

I'm guessing that you are using parseInt() seeing as you used the example documentation. parseInt will only return whole numbers. Try replacing parseInt with parseFloat.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!