fometaPalo
Turns a number into text, padded with zeros before and after the point.
The second number says how many digits to keep before the point, and the third says how many to keep after it.
fometaPalo(123.45)is "123.45"fometaPalo(123.45, 4)is "0123.45"fometaPalo(123.45, 4, 1)is "0123.5" — it roundsfometaPalo(123.45, 4, 3)is "0123.450" — it pads with zeros
A negative number keeps its sign: fometaPalo(-123.45, 5, 2) is "-00123.45".
This is useful when you want changing numbers to stay the same width. Given a list, it returns a list of strings.
Syntax
Section titled “Syntax”fometaPalo(boleng, kwaPele, kwaMorago)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | palo | The number to format. A list of numbers is also accepted. |
kwaPele (optional) | palo | How many digits to keep before the point. |
kwaMorago (optional) | palo | How many digits to keep after the point. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
}
tiro tshwantsha() {
bokamorago(220);
tlogelaMothalo();
diri boleng = fometaPalo(pebaX, 3);
kwala(boleng);
tlatsaMmala(0, 140, 200);
kgolokwe(pebaX, 200, 80);
}tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(220);
tlogelaMothalo();
kwala(fometaPalo(123.45));
kwala(fometaPalo(123.45, 4));
kwala(fometaPalo(123.45, 4, 1));
kwala(fometaPalo(123.45, 4, 3));
tlatsaMmala(200, 140, 60);
thalaKhutlonne(60, 160, 280, 80);
}See also
Section titled “See also”fometaPaloPhegelwana, fometaPaloLetshwao, fometaPaloSebaka, mokwalo