The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Commas in post count

View previous topic View next topic Go down

Commas in post count

Post by Xanthis on August 9th 2011, 1:30 am

Is there some way to change the counters so there's a comma inserted every third digit, like in the post count in user's profiles, or total number of registered users?


Last edited by Xanthis on August 14th 2011, 11:52 pm; edited 1 time in total

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

Re: Commas in post count

Post by hoodedwarbler12 on August 9th 2011, 1:55 am

So if there are 10,000 posts it doesn't already out a comma?

hoodedwarbler12
Forumember

Male Posts : 521
Reputation : 117
Language : English, Latin, HTML, JavaScript
Location : Tennessee, USA

http://www.webkinznation.com

Back to top Go down

Re: Commas in post count

Post by Xanthis on August 9th 2011, 2:20 am

@hoodedwarbler12 wrote:So if there are 10,000 posts it doesn't already out a comma?

No.

Code:
{FORUMCOUNTPOST}

Forumotion's total message count, without the code tags, shows up like this: 979685. You can quote this message to double check.

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

Re: Commas in post count

Post by hoodedwarbler12 on August 9th 2011, 2:24 am

Oh. Well, there's no way to add this without a change to our forums by The Godfather. You could suggest it if you wish. Smile

hoodedwarbler12
Forumember

Male Posts : 521
Reputation : 117
Language : English, Latin, HTML, JavaScript
Location : Tennessee, USA

http://www.webkinznation.com

Back to top Go down

Re: Commas in post count

Post by Mike on August 9th 2011, 3:45 am

Try and add this Javascript to your forum

Code:
<script type="text/javascript">function CommaFormatted(amount)
{
   var delimiter = ","; // replace comma if desired
   amount = new String(amount);
   var a = amount.split('.',2)
   var d = a[1];
   var i = parseInt(a[0]);
   if(isNaN(i)) { return ''; }
   var minus = '';
   if(i < 0) { minus = '-'; }
   i = Math.abs(i);
   var n = new String(i);
   var a = [];
   while(n.length > 3)
   {
      var nn = n.substr(n.length-3);
      a.unshift(nn);
      n = n.substr(0,n.length-3);
   }
   if(n.length > 0) { a.unshift(n); }
   n = a.join(delimiter);
   if(d.length < 1) { amount = n; }
   else { amount = n + '.' + d; }
   amount = minus + amount;
   return amount;
}
// end of function CommaFormatted()</script>

Mike
Hyperactive

Male Posts : 4242
Reputation : 466
Language : English, HTML, CSS
Location : Bozeman, Montana

Back to top Go down

Re: Commas in post count

Post by Xanthis on August 14th 2011, 11:18 pm

Drogba, I'm not entirely sure that the code you gave me works, I submitted it in the form you gave me, and there was no effect, then I deleted the HTML script tags and re-submitted it, and it still doesn't show up. Any suggestions?

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

Re: Commas in post count

Post by Xanthis on August 16th 2011, 7:54 pm

Bumping.

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

Re: Commas in post count

Post by Xanthis on August 19th 2011, 8:40 pm

Bump of redundancy #2.

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

Re: Commas in post count

Post by Xanthis on August 29th 2011, 1:42 am

Bump #3?

Xanthis
Forumember

Male Posts : 210
Reputation : 6
Language : English

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum