Syntax
[C/C++:]
void gDisplayRealExponent(float value, int nwidth, int nplace);
void gDisplayRealFixed(float value, int nwidth, int nplace);
void gDisplayRealFloat(float value, int nwidth);
void gDisplayRealPower(float value, int nwidth, int nplace);
void gDisplayRealScientific(float value, int nwidth, int nplace);
[F90:]
subroutine gDisplayRealExponent(value, nwidth, nplace)
subroutine gDisplayRealFixed(value, nwidth, nplace)
subroutine gDisplayRealFloat(value, nwidth)
subroutine gDisplayRealPower(value, nwidth, nplace)
subroutine gDisplayRealScientific(value, nwidth, nplace)
real, intent(in) :: value
integer, intent(in) :: nwidth,nplace
Arguments
value
Real value
nwidth
Field width
nplace
Number of places after the decimal point
Description
The gDisplayReal set of routines outputs the supplied real
value as a character string in three different floating point formats. Either as a decimal floating-point, a decimal fixed point or a floating point character string. The start point of the string is the current drawing position which will be at the bottom left-hand corner of the numeric field. The end point is the bottom right-hand corner of the numeric field. The characters are drawn subject to the font representation, font weight, character size, orientation, justification, italics and underline settings and are transformed if GINO transformable characters are currently selected.
In all routines, if the number occupies less than
nwidth character positions, the string is padded out with spaces. On the other hand, if the number is longer than
nwidth characters, a string of asterisks is output. For positive values of
nwidth, the number is right-justified. If
nwidth is less than zero, the number is left-justified. The field width is limited to 32 character positions. If it exceeds this, it is set to 32 characters and a warning message is output.
In the case of gDisplayRealExponent(), the number consists of a mantissa followed by a decimal exponent. The mantissa consists of a decimal point (preceded by a minus sign if
value is less than zero) followed by the number of digits specified by
nplace. If
nplace is less than zero, its absolute value is used and a warning message is output. The number is rounded in the last decimal place. A zero is output in front of the decimal point if the number is positive and left-justified or if the number is right-justified and there is room for a leading zero. The exponent occupies 4 character positions. The first character is the letter 'E' and the remaining characters contain the exponent value, right-justified and preceded by a minus sign for negative exponents. Any gap after the letter 'E' is padded out with spaces. If the exponent is too large, the string is filled with asterisks.
In the case of gDisplayRealFixed() the number consists of an integer part (preceded by a minus sign if
value is less than zero) followed by a decimal point and a fractional part. The number of digits for the fractional part is specified by
nplace. If
nplace is less than zero, its absolute value is used and a warning message is output. The number is rounded in the last decimal place. If the integer part is zero, a leading zero is output unless
value is less than zero and there is only room for the minus sign before the decimal point.
In the case of gDisplayRealFloat() the mantissa consists of a decimal point (preceded by a minus sign if
value is less than zero) followed by (
nwidth-6) digits, up to a maximum of 6 digits. If the field width is less than 6, the string is filled with asterisks. The number is rounded in the last decimal place. A zero is output in front of the decimal point if the number is positive and left-justified or if the number is right-justified and there is room for a leading zero. The exponent occupies 4 character positions. The first character is the letter 'E' and the remaining characters contain the exponent value, right-justified and preceded by a minus sign for negative exponents. Any gap after the letter 'E' is padded with spaces. If the exponent is too large, the string is filled with asterisks.
In the case of gDisplayRealPower() the number is displayed in the same format as gDisplayRealExponent() except that the exponent only occupies the number of character fields required and is displayed as a real exponent, by reducing the size of the exponent value and displaying it raised above the base line. The attributes of the exponent display are controlled by the routine gSetStrExponent().
In the case of gDisplayRealScientific() the number is displayed in the same format as gDisplayRealExponent() except that the exponent only occupies the number of character fields required and the mantisa is a value between 1.0 and 10.0 thus reducing the exponent value by one.
See Also
gDisplayRealExponent UsagegSetStrExponent()