Commas in post count
3 posters
Page 1 of 1
Commas in post count
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
- Posts : 210
Reputation : 6
Language : English
Re: Commas in post count
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: 1087991. You can quote this message to double check.
Xanthis- Forumember
- Posts : 210
Reputation : 6
Language : English
Re: Commas in post count
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.
Re: Commas in post count
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
- Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado
Re: Commas in post count
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
- Posts : 210
Reputation : 6
Language : English
Re: Commas in post count
Bump of redundancy #2.
Xanthis- Forumember
- Posts : 210
Reputation : 6
Language : English
Similar topics
» Move Position of Thread Count/Post Count/Most Recent Post
» Can I disable the post count in a board where if you post in that board it won't raise your post count?
» Make it so posts in a forum don't count towards post count?
» How do I make a forum area not count towards post count..?
» [Forum] Post Count Dont Count -
» Can I disable the post count in a board where if you post in that board it won't raise your post count?
» Make it so posts in a forum don't count towards post count?
» How do I make a forum area not count towards post count..?
» [Forum] Post Count Dont Count -
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum