how do I get a value to 5 decimal places (double) from iSAR(NULL,0,0.02,0.2,0) ?

 

how do I get a value to 5 decimal places (double) from iSAR(NULL,0,0.02,0.2,0) ?

.

If I use double SARba = iSAR(NULL,0,0.02,0.2,0);

I only get it to 4 decimal places

 

probably becaure you are using default number of decimal places to print see DoubleToStr() for alternate decimal place number printing.

 
Ickyrus:

probably becaure you are using default number of decimal places to print see DoubleToStr() for alternate decimal place number printing.


this is the code I have

double SARba = iSAR(NULL,0,0.02,0.2,0);

string SARa = DoubleToStr(iSAR(NULL,0,0.02,0.2,0),5);

how do I get a value to 5 decimal places (double) from iSAR(NULL,0,0.02,0.2,0) ?

 

u want extract 5 dec. from the string ?

 

What code are you using to display your variables - using the Print function, the Alert or comment?

 

ObjectCreate()

 
MickGlancy:


this is the code I have

double SARba = iSAR(NULL,0,0.02,0.2,0);

string SARa = DoubleToStr(iSAR(NULL,0,0.02,0.2,0),5);

how do I get a value to 5 decimal places (double) from iSAR(NULL,0,0.02,0.2,0) ?


double SARba = NormnalizeDouble(iSAR(NULL,0,0.02,0.2,0),5);

 
Ickyrus:

What code are you using to display your variables - using the Print function, the Alert or comment?


Comment, but I know want the number itself for an internal calculation
 
1005phillip:


double SARba1 = NormalizeDouble(iSAR(NULL,0,0.02,0.2,0),5); returns 0
 
qjol:

u want extract 5 dec. from the string ?


no I want to get the value of iSAR to 5 decimal places instead of 4 (to point value rather than pip)
 
MickGlancy:

double SARba1 = NormalizeDouble(iSAR(NULL,0,0.02,0.2,0),5); returns 0

The only way that is possible is if "double SARba = iSAR(NULL,0,0.02,0.2,0);" itself returns zero or a number smaller than 0.000005.
Reason: