* Andy Ross -- Tuesday 08 March 2005 19:52:
> Indeed, there is no formatted text mechanism in Nasal right now.
> Everything is printed to the precision of a full double.

I've added a rounding function to 
http://members.aon.at/mfranz/flightgear/calctile.nas
that should be good enough for most purposes:

  round(number, digits=0, suppress=1, trunc=0)

Only the <number> is mandatory. Positive <digits> round after the comma, 
negative
before the comma. <suppress> discards trailing zeros after the comma, and trunc
replaces rounding by truncation. "nil" may be used for all optional parameters
and is replaced by the respective defaults. Examples:

  round(123.456789);
  round(123.456789, 1);
  round(123.456789, 4, nil, 1);

m.

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to