palotlalo
Converts text, a number, or a
nnete/maakavalue into a whole number.
It removes the fractional part and does not round: palotlalo(67.89) is 67, and palotlalo(-34.56) is -34. Both move towards 0 rather than towards the lower number.
Given nnete you get 1, and maaka gives 0. When text cannot be read as a number — say palotlalo("kgomo") — you get NaN, meaning "not a number".
Given a list, it returns a new list with every value converted; the original list is unchanged.
Syntax
Section titled “Syntax”palotlalo(boleng)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | sengwe | Text, a number, or nnete/maaka. A list of those is also accepted. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(220);
tlogelaMothalo();
diri boleng = "180";
diri bogolo = palotlalo(boleng);
kwala(bogolo);
tlatsaMmala(0, 140, 200);
kgolokwe(200, 200, bogolo);
}tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(220);
tlogelaMothalo();
diri tekanyo = 167.89;
diri bogolo = palotlalo(tekanyo);
kwala(tekanyo);
kwala(bogolo);
// Bara e e kwa godimo ke palo ya ntlha; e e kwa tlase ke palotlalo
tlatsaMmala(200, 120, 70);
thalaKhutlonne(40, 120, tekanyo, 60);
tlatsaMmala(0, 140, 200);
thalaKhutlonne(40, 220, bogolo, 60);
}