NAME
std/lingua/en - English text helpers for ZuzuScript.
SYNOPSIS
from std/lingua/en import *;
say( english_list(["tea", "cake", "jam"]) );
# tea, cake, and jam
say( english_number(251) );
# two hundred and fifty-one
say( english_ordinal(42) );
# forty-second
IMPLEMENTATION SUPPORT
This module is supported by all implementations of ZuzuScript.
DESCRIPTION
This module provides pure-Zuzu helpers for presenting English text, using British English conventions (including the serial comma and "and" in hundreds).
EXPORTS
Functions
english_list(Collection c, String j := "and")Parameters:
cis an ordered collection andjis the conjunction before the final item. Returns:Stringornull. Formats a list of values into English prose.english_number(Number n, Number cutoff?)Parameters:
nis the number to render andcutoffis an optional numeric rendering limit. Returns:String. Renders a number in English words, falling back to digits whenabs(n)exceedscutoff.english_ordinal(Number n, Number cutoff?)Parameters:
nis the number to render andcutoffis an optional numeric rendering limit. Returns:String. Renders an ordinal form such asfirst,second, orthird.
COPYRIGHT AND LICENCE
std/lingua/en is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.