Syntax
[C/C++:]
void gConvertRealExponent(float value, int nwidth, int nplace, char string[]);
void gConvertRealFixed(float value, int nwidth, int nplace, char string[]);
void gConvertRealFloat(float value, int nwidth, char string[]);
void gConvertRealPower(float value, int nwidth, int nplace, char string[]);
void gConvertRealScientific(float value, int nwidth, int nplace, char string[]);
[F90:]
subroutine gConvertRealExponent(value, nwidth ,nplace, string)
subroutine gConvertRealFixed(value, nwidth, nplace, string)
subroutine gConvertRealFloat(value, nwidth, string)
subroutine gConvertRealPower(value, nwidth, nplace, string)
subroutine gConvertRealScientific(value, nwidth, nplace, string)
real, intent(in) :: value
integer, intent(in) :: nwidth,nplace
character*(*), intent(out) :: string
Arguments
value
Real value
nwidth
Field width
nplace
Number of places after the decimal point
string
Character string containing value
Description
The gConvertReal set of routines converts the supplied real value into a character string in five different floating point formats. Either as a decimal floating-point, a decimal fixed point or a floating point character string in the argument
string. The format of the number is exactly the same as that output by the equivalent gDisplayReal routine.
In all five 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, the string is filled with asterisks. For positive values of
nwidth, the number is right-justified. If
nwidth is less than zero, the number is left-justified. All routines return a blank string if
nwidth is zero. 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.
Refer to the specification of the gDisplayReal routines for a detailed description of the output format of each of these routines. Note that the string returned by gConvertRealPower() routine will contain a GINO escape sequence composed of the current escape character and the character 'E' to construct the exponent value. If the escape character is changed before utilizing the returned string, then the display will not be correct.
See Also
gConvertRealFloat UsagegDisplayRealExponentgDisplayRealFixedgDisplayRealFloatgDisplayRealPowergDisplayRealScientific