|
Simple question: I want to get the number of digits to the left of the
decimal place from a value in a numeric variable (excluding negative sign
if there is one).
I can live with the following which works but I'm wondering if it can be
even simpler than this? I thought there might be a numeric function to do
it directly but couldn't find one.
y = 76877.234;
result = countc(put(int(y),32.),,"d");
or
result = length(compress(put(int(y),32.)," -"));
|