Skip to content

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 rounds
  • fometaPalo(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.

fometaPalo(boleng, kwaPele, kwaMorago)
NameTypeDescription
bolengpaloThe number to format. A list of numbers is also accepted.
kwaPele (optional)paloHow many digits to keep before the point.
kwaMorago (optional)paloHow many digits to keep after the point.
A mouse position that keeps a steady width
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);
}
Rounding and padding with zeros
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);
}

fometaPaloPhegelwana, fometaPaloLetshwao, fometaPaloSebaka, mokwalo