From OpenSCADAWiki
Jump to: navigation, search
  • Integer and real number:
Properties:
  • MAX_VALUE — maximum value;
  • MIN_VALUE — minimum value;
  • NaN — error value.
Functions:
  • bool isEVal(); bool isNaN( ); — checks the value to null-EVAL, and NaN for Real.
  • string toExponential( int numbs = -1 ); — returns the string of the number, formatted in the exponential notation, and with the number of significant digits numbs. If numbs is missing the number of digits will have as much as needed.
  • string toFixed( int numbs = 0, int len = 0, bool sign = false ); — returns the string of the number, formatted in the notation of fixed-point, and with the number of significant digits after the decimal point numbs, for minimum length len and compulsion to the presence of a sign. If numbs is missing, the number of digits after the decimal point is equal to zero.
  • string toPrecision( int prec = -1 ); — returns the string of the number, formatted with the number of significant digits prec.
  • string toString( int base = 10, int len = -1, bool sign = false ); — returns the string of the number of the integer type, formatted with the following representation base (2-36), for minimum length len and compulsion to the presence of a sign.
  • real toReal(); — reads this integer-real as a real number.
  • int toInt(); — reads this integer-real as an integer number.