I am trying to format a number variable *b* if it is less than 1, so Stata will ad a "0" to before the decimal point. Would also like 3 places behind the decimal. Does not seem to be working. Still outputs a variable *b* that has 9 numbers after the decimal. Cross posted this to reddit (https://www.reddit.com/r/stata/comme...er_variables/?).
Code:
if b>1{
*code here that is not relevant to the question
}
else{
format b %09.3g
*code here that is not relevant to the question
}

Comment