2007-12-24 00:06:53 -05:00
|
|
|
USING: help.markup help.syntax math strings ;
|
2008-01-06 22:21:58 -05:00
|
|
|
IN: math.text.english
|
2007-12-24 00:06:53 -05:00
|
|
|
|
|
|
|
|
HELP: number>text
|
|
|
|
|
{ $values { "n" integer } { "str" string } }
|
2018-02-15 16:21:27 -05:00
|
|
|
{ $contract "Converts an integer to a text string representation in English, including appropriate punctuation and conjunctions." }
|
2009-08-11 16:35:57 -04:00
|
|
|
{ $examples { $example "USING: math.text.english prettyprint ;" "12345 number>text ." "\"twelve thousand, three hundred and forty-five\"" } } ;
|
2018-02-15 16:21:27 -05:00
|
|
|
|
|
|
|
|
HELP: ordinal-suffix
|
|
|
|
|
{ $values { "n" number } { "suffix" string } }
|
|
|
|
|
{ $description "Determine the ordinal suffix for the input number. Non-integral numbers get the ordinal suffix of their integral part." }
|
|
|
|
|
{ $examples
|
|
|
|
|
{ $example
|
|
|
|
|
"USING: kernel math.parser math.text.english prettyprint sequences ;"
|
|
|
|
|
"783 [ number>string ] [ ordinal-suffix ] bi append ."
|
|
|
|
|
"\"783rd\""
|
|
|
|
|
}
|
|
|
|
|
} ;
|