Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-01-2012, 09:50 AM   PM User | #16
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
Not offhand. I waste as little time as possible on you.
I'll take that as a "No because there aren't any" then to

Quote:
Can you post a link to a post where you say I said that.

Last edited by Mishu; 04-01-2012 at 09:53 AM..
Mishu is offline   Reply With Quote
Old 04-01-2012, 10:05 AM   PM User | #17
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
to the OP:

If you really want ordinal numbers, you don't need to use an array because it's a messy way of doing it for the reasons I posted before. There are lots of examples on google - pick one

This is the function I have been using for ages now. Just call it in the example I posted wherever you want an ordinal number.

Code:
                
                function getOrdinalNumber(n) {
                    var s=["th","st","nd","rd"],
                    v=n%100;
                    return n+(s[(v-20)%10]||s[v]||s[0]);
                }

Last edited by Mishu; 04-01-2012 at 10:08 AM..
Mishu is offline   Reply With Quote
Old 04-01-2012, 11:28 AM   PM User | #18
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
HungryChapstick - just ignore the guy. That post is stupidly inappropriate. He knows perfectly well that you could not submit that code as your student homework, nor even explain it probably, and is only trying to show off how amazingly clever he is, and increase his post count (he has a lot of leeway to make up after being banned from the forum so often).

I expect he will retort with some jejeune rubbish like "I think the OP can decide for him/her self if the example I posted is correct, useful or whatever to them."
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 04-01-2012, 11:32 AM   PM User | #19
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
I expect he will retort with some jejeune rubbish like "I think the OP can decide for him/her self if the example I posted is correct, useful or whatever to them."
I don't have to. You did it for me with the red bit

Last edited by Mishu; 04-01-2012 at 12:07 PM..
Mishu is offline   Reply With Quote
Old 04-01-2012, 11:44 AM   PM User | #20
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Mishu View Post
I don't have to. You did it for me
Glad that you agree that it is jejeune rubbish!
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 04-01-2012, 11:52 AM   PM User | #21
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
Glad that you agree that it is jejeune rubbish!
Let's see if the moderators agree with you.

I agree only with my original quote, that's why I highlighted it in red

Quote:
Originally Posted by Mishu View Post
I think the op can decide for him/her self if the example I posted is correct, useful or whatever to them. I doubt they need you to decide for them

Last edited by Mishu; 04-01-2012 at 01:03 PM..
Mishu is offline   Reply With Quote
Old 04-02-2012, 01:43 AM   PM User | #22
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
HungryChapstick - just ignore the guy. That post is stupidly inappropriate.
Then how come the mods haven't removed any of my posts?

It's probably because they don't agree with you.

Last edited by Mishu; 04-02-2012 at 02:25 AM..
Mishu is offline   Reply With Quote
Old 04-02-2012, 07:59 AM   PM User | #23
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Mishu View Post
Then how come the mods haven't removed any of my posts?

It's probably because they don't agree with you.
Mods do not remove posts that are merely incorrect or even silly. They only remove posts which are insulting or abusive - as you yourself know well from long experience of being banned for exactly that.

Perhaps the mods have not removed any of my posts because they do agree with me!
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 04-02-2012, 08:06 AM   PM User | #24
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
Mods do not remove posts that are merely incorrect or even silly.
The example code I posted is neither.

Quote:
Originally Posted by Philip M View Post
Perhaps the mods have not removed any of my posts because they do agree with me!
If the mods are happy with your posts. I have no probs with that. But I can't be forced to agree with what you say though

Last edited by Mishu; 04-02-2012 at 08:09 AM..
Mishu is offline   Reply With Quote
Old 04-02-2012, 08:27 AM   PM User | #25
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Mishu View Post
The example code I posted is neither.

If the mods are happy with your posts. I have no probs with that. But I can't be forced to agree with what you say though
Snap!
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 04-02-2012, 08:57 AM   PM User | #26
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
Quote:
Originally Posted by Philip M View Post
Snap!
good to see we agree on something finally
Mishu is offline   Reply With Quote
Reply

Bookmarks

Tags
game, guess, javascript, number, problem

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:13 PM.


Advertisement
Log in to turn off these ads.