Title: Checkboxes and calculation
Last modified: April 8, 2017

---

# Checkboxes and calculation

 *  Resolved [FramSteget](https://wordpress.org/support/users/framsteget/)
 * (@framsteget)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-and-calculation/)
 * Hi,
    When checking more than one checkbox calculations are not correct.
 * URL: [https://xn--tryckbcker-jcb.se/produkt/pdf-for-tryckning/](https://xn--tryckbcker-jcb.se/produkt/pdf-for-tryckning/)
 * Under “PRISBERÄKNING” enter 10000 in field “Skriv in antal ord*”.
    Checkbox #
   1 has value 2200 Checkbox #2 has value 3200
 * When the two checkboxes are checked the calculation reads 22,004,300 kr. It should
   be 6,500 kr.
    The calculation should be 2,200+4,300=6,500, but it shows 22,004,300.
    -  This topic was modified 9 years, 2 months ago by [FramSteget](https://wordpress.org/support/users/framsteget/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-and-calculation/#post-9009875)
 * Hello [@framsteget](https://wordpress.org/support/users/framsteget/),
 * For some reason, the values are being treated as texts instead numbers and are
   being cocatenated.
 * Please, follow the steps below to force the browser to treat them as numbers (
   I will include the modifications in the official distribution of the plugin):
 * 1. Open the “/wp-content/plugins/calculated-fields-form/js/fields-public/06_fbuilder.
   fcheck.js” file with the text editor of your choice.
 * 2. Go to the piece of code:
 * `if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');`
 * and modify it as follows:
 *     ```
       if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');
       else t = t*1;
       ```
   
 * 3. Finally, delete the file: “/wp-content/plugins/calculated-fields-form/js/cache/
   all.js” to allow the changes take effect, and that’s all.
 * Best regards.
 *  Thread Starter [FramSteget](https://wordpress.org/support/users/framsteget/)
 * (@framsteget)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-and-calculation/#post-9010092)
 * Hi,
    Now it’s working. Calculations are done fast on Chrome. But all other browsers
   are very slow when there are much code to process.
 * Thanks
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-and-calculation/#post-9010120)
 * Hello,
 * I’m testing your form in different browsers and the performance is similar in
   all of thems. Remember that if you have deleted the cached file (all.js) the 
   plugin will generate it again the first time the form is loaded, and the process
   is more time consuming, but one time the cached file is created the form’s performance
   is increased dramatically.
 * Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Checkboxes and calculation’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [checkboxes](https://wordpress.org/support/topic-tag/checkboxes/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/checkboxes-and-calculation/#post-9010120)
 * Status: resolved