So if anyone ELSE could help me, I would sure appreciate it.
I need a formula to tell me how many decimal places are in a number. Given the variable TickSize, how can I tell the number of decimal places are in that variable? I've tried a lot of things... logarithms, dividing, you name it. I cannot figure this out, and it's got to be simple. For now, this is what I'm doing, but it's crazy messy, and it's an amateur way of programming for this highly professional programmer.
int decimals = 0;
if (TickSize == .1) decimals = 1;
if (TickSize == .25) decimals = 2;
if (TickSize == .01) decimals = 2;
if (TickSize == .025) decimals = 3;
if (TickSize == .001) decimals = 3;
if (TickSize == .0025) decimals = 4;
if (TickSize == .0001) decimals = 4;
Thanks!
Bryan
Comment