Download MetaTrader 5

Round numbers

To add comments, please log in or register
Vojtech Slavinsky
155
Vojtech Slavinsky  

Hello,

 how I round number to 5 decimals places?

 

Thank 

Alain Verleyen
Moderator
32025
Alain Verleyen  
Slavin12:

Hello,

 how I round number to 5 decimals places?

 

Thank 

It depends, what's your goal ?
Vojtech Slavinsky
155
Vojtech Slavinsky  
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
6040
Stuart Browne  
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
32025
Alain Verleyen  
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