Download MetaTrader 5

Round numbers

To add comments, please log in or register
Add our channel to friends and follow the news!
Vojtech Slavinsky
155
Vojtech Slavinsky 2015.01.03 22:37 

Hello,

 how I round number to 5 decimals places?

 

Thank 

Alain Verleyen
Moderator
30743
Alain Verleyen 2015.01.03 22:41  
Slavin12:

Hello,

 how I round number to 5 decimals places?

 

Thank 

It depends, what's your goal ?
Vojtech Slavinsky
155
Vojtech Slavinsky 2015.01.03 22:48  
angevoyageur:
Záleží na tom, jaký je váš cíl?
My script return value, but this value can have whatever decimal place. I need some decimal places as have symbol().
Stuart Browne
5815
Stuart Browne 2015.01.04 00:49  
Slavin12:

Hello,

 how I round number to 5 decimals places?

 

Thank 

See here: https://www.mql5.com/en/docs/convert/normalizedouble

Documentation on MQL5: Conversion Functions / NormalizeDouble
Documentation on MQL5: Conversion Functions / NormalizeDouble
  • www.mql5.com
Conversion Functions / NormalizeDouble - Reference on algorithmic/automated trading language for MetaTrader 5
Alain Verleyen
Moderator
30743
Alain Verleyen 2015.01.04 14:06  
Slavin12:
My script return value, but this value can have whatever decimal place. I need some decimal places as have symbol().

If it's an output issue, you can either use :

   Print("Value = ",DoubleToString(value,5);
or
   printf("My value is %.5f",value);
To add comments, please log in or register