Hi,

I haven't found existing code. So I'll do that: in Integer

Integer>>englishEndString
        (self rem: 1) isZero ifTrue: [^'st'].
        (self rem: 2) isZero ifTrue: [^'nd'].
        (self rem: 3) isZero ifTrue: [^'rd'].
        ^'th'

Integer>>asEnglishString

        self asString , self englishEndString

hth,

2008/12/11 Tim Johnson <[email protected]>:
> Hi,
>
> Does anyone have, or know of, existing code to perform the rather
> anglo-centric (?) function of turning 3 into '3rd,' 22 into '22nd,' etc.?
>
> Thanks,
> TimJ
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>



-- 
Cédrick
_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to