How to specify output width of an PragmARC.Unbounded_Numbers.Integers big integer?
I don’t see any formatting options…so I’m just using a Put_Line. Would like to place a couple per line (I have 30 to display). I’d like to have a nice alignment.
function Image (Value : in PragmARC.Unbounded_Numbers.Unbounded_Integer; Width : in Natural := 0) return String
with
Post => Image'Result'Length >= Width;
-- Returns an image of Value, left padded with spaces if necessary
function Image (Value : in PragmARC.Unbounded_Numbers.Unbounded_Integer; Width : in Natural := 0) return String is
Img : constant String := PragmARC.Unbounded_Numbers.Integers.Image (Value);
begin -- Image
return (1 .. Width - Img'Length => ' ') & Img;
end Image;
If you want something other than spaces then you might want to treat negative numbers differently.