Need help, how to get the last number of a bigger number? - page 2

 
mike5n:

Please how can I get the number of digits after a decimal point.

for example:

int a = 3446.64643231;

how can I get the number of digits after the decimal point which is 8 in this example.

Thanks for the help. 

int a = 3446.64643231;

a is an integer.

a= 3446 , so there will be no decimal point and no digits after it.

I don't see that there is any way to get the number of digits for a floating point number. The only way would be if it is input as a string.

Why do you need this? Please show an example of how it would be useful.

 

Please how can I get the number of digits after a decimal point.

for example:

double a = 3446.64643231;

how can I get the number of digits after the decimal point which is 8 in this example.

Thanks for the help. 

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING. Some symbols...
 
mike5n:

Please how can I get the number of digits after a decimal point.

I see that you have deleted your original post and now declare a as a double.

Doesn't make any difference as I cannot see how it can be done reliably.

Please answer my previous question.

Keith Watford:

Why do you need this? Please show an example of how it would be useful.

Reason: