[integer-asStringOrd]

Description

Link: [integer-asStringOrd]
Author: Brad Lindsay
Category: Namespace
Version: 9.x
License: Public Domain
Posted: Dec. 27, 2011
Updated: Dec. 28, 2011
More by this author...
The [integer->asStringOrd] returns the ordinal format of an integer.

Parameters

none


Sample Usage

1->asStringOrd

// Returns '1st'
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
define integer->asStringOrd => {
    (:11,12,13)->contains(self % 100)?
        return self->asString + 'th'

    return self->asString + (:'th','st','nd','rd','th','th','th','th','th','th')->get((self % 10) + 1)
}

 

Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net