Print floats in ada

I want to print a floating point number, I am using the FLOAT_IO package.

Is there a way to control the number of digits after the point and before it?

+7
source share
1 answer

The Put procedure in Ada.Text_Float_IO has three optional parameters for controlling the format Fore , Aft , Exp , which control the output. The meaning of these parameters is as follows:

  • Fore indicates the number of digits (including a possible negative sign and leading zeros) before the point;
  • Aft indicates the number of digits after the period (including any trailing zeros);
  • Exp indicates the number of digits of the exponent (if necessary).

For a more detailed description and default values ​​for parameters that control the format, see Ada 95 Reference Manual, Section A.10.9 .

+6
source

All Articles