In Stata (and Mata) there are left-justified and right-justified formats for numbers. For some reason strofreal() function does not obey the change in justification while the sprintf() works as I expected (Stata 13.0). I wonder if this is a bug or is there a reason for this. Compare for illustration:
(the angle brackets are added for clarity)
I am interested in which format will deliver the behavior with leading spaces (not zeroes)? and whether the behavior of strofreal() or sprintf() is more intuitive?
Thank you,
Sergiy Radyakin
Code:
mata "<"+strofreal(7,"%-2.0f")+">" mata "<"+strofreal(7,"%2.0f")+">" mata sprintf("<%2.0f>",7) mata sprintf("<%-2.0f>",7)
(the angle brackets are added for clarity)
I am interested in which format will deliver the behavior with leading spaces (not zeroes)? and whether the behavior of strofreal() or sprintf() is more intuitive?
Thank you,
Sergiy Radyakin
Comment