Title: Counter Issue with JavaScript engine
Last modified: November 18, 2019

---

# Counter Issue with JavaScript engine

 *  [a3web](https://wordpress.org/support/users/a3web/)
 * (@a3web)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/counter-issue-with-javascript-engine/)
 * Hi,
 * We found an issue in your Counter Up Block. Due to the way JavaScript handle 
   small numbers, your Count Up Block is a little buggy with certain integers. For
   example: 228 / 100 * 100 give as a result : 227.9999999997 and get rounded to
   227 by the “parseInt” method.
 * Perhaps your should use a “Math.round” instead of the “parseInt”.
    If the use
   of parseInt is mandatory for you, simply invert the calculation ( “i * f / n”
   instead of “i / n * f” ) should limit the “buggy cases”.
 * We saw it depends on a library you use (jQuery count up by Benjamin Intal). Maybe
   you should update this library in your package because it’s pretty old.
 * Best regards

Viewing 1 replies (of 1 total)

 *  [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/counter-issue-with-javascript-engine/#post-12154226)
 * Hi,
 * I see the problem indeed, we need to update the script it’s based on. We’ll include
   that in the next version.
 * Cheers,

Viewing 1 replies (of 1 total)

The topic ‘Counter Issue with JavaScript engine’ is closed to new replies.

 * ![](https://ps.w.org/advanced-gutenberg/assets/icon-256x256.png?rev=3393761)
 * [PublishPress Blocks - Block Controls, Block Visibility, Block Permissions](https://wordpress.org/plugins/advanced-gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-gutenberg/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/counter-issue-with-javascript-engine/#post-12154226)
 * Status: not a support question