mIRC Homepage
Posted By: codemastr $ord and decimals - 18/06/03 06:57 PM
$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.
Posted By: WatchMinister Re: $ord and decimals - 18/06/03 08:00 PM
so $gettok it?
Posted By: codemastr Re: $ord and decimals - 18/06/03 08:01 PM
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.
Posted By: starbucks_mafia Re: $ord and decimals - 19/06/03 11:43 AM
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.
Posted By: codemastr Re: $ord and decimals - 19/06/03 03:04 PM
Yea I've never seen ordinals used for floating point either, th just sounded the least wrong to me.
Posted By: Raccoon Re: $ord and decimals - 19/06/03 11:05 PM
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
Posted By: codemastr Re: $ord and decimals - 20/06/03 03:02 PM
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.
© mIRC Discussion Forums