How does one print several values on a single line. I want to print variable values as a table at runtime. All are floating point single precision. I want to format the output with two decimal places. This is for debugging.
Suppose a = 88.1234, b=99.1234.
At runtime, I want the listener to echo:
88.12 99.12
Thanks,
Dave
Solved! Go to Solution.
Solved by denisT.MaxDoctor. Go to Solution.
Also, it would be nice if there was a format string that handled column alignment, like in FORTRAN (yes, I'm old, thank you).
use format (instead of print) and formattedprint (to format values):
format "% % % %\n" \
(formattedprint pi format:".4f") \
(formattedprint pi format:".3f") \
(formattedprint pi format:".2f") \
(formattedprint pi format:".1f")
see MXS help for more details.
Awesome, thanks!
Can't find what you're looking for? Ask the community or share your knowledge.