Title: . between digits.
Last modified: August 22, 2016

---

# . between digits.

 *  Resolved [jochenc](https://wordpress.org/support/users/jochenc/)
 * (@jochenc)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/)
 * Is it possible to have a . between the digits for example 1.000.000?
 * I was looking at the plugin code but didn’t get to far 🙂
 * Thanks for your help!
 * [https://wordpress.org/plugins/jellyfish-counter-widget/](https://wordpress.org/plugins/jellyfish-counter-widget/)

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

 *  Plugin Author [Strawberry Jellyfish](https://wordpress.org/support/users/toxictoad/)
 * (@toxictoad)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/#post-5303568)
 * hmmmmmmm…. tricky!
 * This _might_ be possible with some cunning CSS **nth-child() ::before** style
   selectors to inject the separating character between digit divs. But I think 
   I’d avoid trying that because the current inline styles on digits make that kind
   of thing a bit of a pain (this is all due to change and become less painful in
   a future version)
 * Or, modify the odometer.js javascript something like this:
 * In odometer.js, look for line 136 that begins `digitInfo.push(...`
 * Insert the following code between lines 136 and 137
 *     ```
       // inserting a styled separator character after 1st and 4th digits
               if (i == 0 || i == 3) {
                   var separator = document.createElement("div");
                   // separator character
                   separator.innerHTML = '.'
                   // add styles to match digits
                   separator.style.cssText = style.digits;
                   var separatorDiv = document.createElement("div");
                   separatorDiv.style.cssText = style.columns;
                   separatorDiv.appendChild(separator);
                   // if we are using the 3d highlight effect, add it
                   if (!this.disableHighlights) {
                       for (var j in highlights) {
                           var hdiv = document.createElement("div");
                           hdiv.innerHTML="<p></p>";
                           hdiv.style.cssText = highlights[j];
                           separatorDiv.appendChild(hdiv);
                       }
                   }
                   odometerDiv.appendChild(separatorDiv);
               }
       ```
   
 * Now that should give you a ‘.’ after the first and fourth digits of the counter
   like your example (just change the conditions of the first line to alter positions)
 * You’ll also need to alter line 106 from:
 * `odometerDiv.style.cssText="text-align: left; width:"+(this.digitWidth*this.digits)
   +"px; height:"+this.digitHeight+"px";`
 * to:
 * `odometerDiv.style.cssText="text-align: left; width:"+(this.digitWidth*(this.
   digits+2))+"px; height:"+this.digitHeight+"px";`
 * This line just adds extra width to the counter so the new characters fit in, 
   note the (this.digits+2), just change as appropriate if you want more or less
   separators
 * Well that’ll either do exactly what you want or be close enough to get you started.
   Remember any modifications here will effect all counters and the changes will
   be lost if you update the plugin when a new version comes out.
 * Have fun and shout out if you get stuck!
 *  Thread Starter [jochenc](https://wordpress.org/support/users/jochenc/)
 * (@jochenc)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/#post-5303590)
 * Woooow!! Thank you so much for your help!
    I will try this as soon as I find 
   the time (currently working on a other project). I will let you know how everything
   worked out!
 *  Thread Starter [jochenc](https://wordpress.org/support/users/jochenc/)
 * (@jochenc)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/#post-5303682)
 * Worked like a charm! Thanks a lot!
 *  Plugin Author [Strawberry Jellyfish](https://wordpress.org/support/users/toxictoad/)
 * (@toxictoad)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/#post-5303700)
 * Glad that worked out for you.
 * Incidentally, a variation of this feature has made it into the next version of
   the counter, where you can define a pattern for the counter to include “non counting”
   parts, such as symbols between digits like you needed, prefixes, postfixes etc.
 * Currently under test, to be released.. sometime in the not too distant future.(“
   Sometime” being dependant on my spare time :D)

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

The topic ‘. between digits.’ is closed to new replies.

 * ![](https://ps.w.org/jellyfish-counter-widget/assets/icon-256x256.jpg?rev=1009888)
 * [Jellyfish Counter Widget](https://wordpress.org/plugins/jellyfish-counter-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jellyfish-counter-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jellyfish-counter-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/jellyfish-counter-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jellyfish-counter-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jellyfish-counter-widget/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Strawberry Jellyfish](https://wordpress.org/support/users/toxictoad/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/between-digits/#post-5303700)
 * Status: resolved