(1) I'd like to get the last number of decimal (for example : if hh = 1.3257, I'd like to register an integer of 7).
(2) I've done the following but found out that after casting into an integer( vb ), the last digit was not the same and ended up I was getting the wrong value ( vc ). May I know where I've made mistakes? Thanks!
if(Bars.FirstBarOfSession)
{
hh = High[0];
}
double va = hh*10000;
int vb = (int) va;
int vc = vb % 10;
Print(hh.ToString("0.0000") + " " + va.ToString("00000") + " " + vb.ToString("00000") + " " + vc.ToString("0"));
Comment