Suppose i want to print numbers in a loop/table For[n = 1, n < 31, n++, Print[BaseForm[n ,7]]]
the output comes with numbers left adjusted. How Can I make them right adjusted?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityTry using Column
and Alignment
:
Column[BaseForm[#, 7] & /@ Range[30], Alignment -> Right]
which produces the following right-adjusted output:
Thanks, how would you make a multi-column. Say I also want to print i in base 5 in a second column?
Try this:
Grid[Outer[BaseForm[#1, #2] &, Range[30], Range[2, 16]], Alignment -> Right]
which produces this: