mIRC Home    About    Download    Register    News    Help

Print Thread
#30684 18/06/03 06:57 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
OP Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
$ord has a very weird way of handling decimals.

$ord(2.0) = 2.0th
$ord(2.1) = 2.1st

I've never heard someone say "two point first" or "two point onest" Seeing as how it is tenTH hundredTH thousandTH, etc. it would seem to be that $ord(2.1) should be 2.1th. Also shouldn't it really return the same thing for $ord(2) and $ord(2.0)? It seems it just tests whatever the last character is, but thats not always right.

#30685 18/06/03 08:00 PM
Joined: Jun 2003
Posts: 32
Ameglian cow
Offline
Ameglian cow
Joined: Jun 2003
Posts: 32
so $gettok it?

#30686 18/06/03 08:01 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
OP Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I never said there wasn't a way around it, I just said it was a bug. Most of the bugs that are reported can be worked around.

#30687 19/06/03 11:43 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I'm no languologist (partly because I haven't studied English past high school level, mostly because I made that word up), but would an ordinal suffix be used on floating point numbers? Saying something like '2.1th' or '2.4th' just sounds wrong to me. In my mind those suffixes are used to represent a 'whole thing', so only integers should apply. Meaning $ord() shouldn't add anything to the input if it's not an integer. I have no clue whether that's correct from a strict English point of view but I can say I've never seen a decimal number have an ordinal suffix applied to it and I can't find any rule-set or list of ordinal numbers which even mentions non-integers.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#30688 19/06/03 03:04 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
OP Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Yea I've never seen ordinals used for floating point either, th just sounded the least wrong to me.

#30689 19/06/03 11:05 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Actually, I would agree that decimal values should have an $ord of 'th'. Ordinals convert a number's meaning to make it relative to some other number, so just its availability seems necessary for decimal values... even if you don't see it in common use.

However, I like how $ord treats the last character as it does, allowing $ord(1/3) to return 1/3rd. Just wish there was some accepted way to represent 'one half' like 1/2lf. frown

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#30690 20/06/03 03:02 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
OP Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well the thing is, mIRC pretty much ignores whatever you input and just looks at the last character.
$ord(dhjsjhdsakjhdjkshdsad1)
That will add an 'st'. If you ask me it should function like most other identifiers in mIRC and drop invalid characters. I mean if I type $calc(asdf1 + 2) I don't get asdf3 as a result.


Link Copied to Clipboard