--  The attributes of decimal fixed-point types (RM 3.5.10): Digits, Scale and Round, which
--  rounds to the nearest value (halves away from zero) where a conversion truncates.
with Ada.Text_IO;
procedure Main is
   type Money is delta 0.01 digits 12;
   type Fine is delta 0.001 digits 9;
   X : constant Fine := 2.345;
   Y : constant Fine := -2.345;
   Z : constant Fine := 2.344;
begin
   pragma Assert (Money'Digits = 12 and Money'Scale = 2 and Fine'Scale = 3);
   Ada.Text_IO.Put_Line (Integer'Image (Money'Digits) & Integer'Image (Money'Scale));
   Ada.Text_IO.Put_Line (Money'Image (Money'Round (X)) & Money'Image (Money'Round (Y)) & Money'Image (Money'Round (Z)) & Money'Image (Money (X)));
   Ada.Text_IO.Put_Line (Money'Image (Money'Round (1.005)));
end Main;
