Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Rounding
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=165&t=52911
Page 1 of 1

Author:  amine_chourou [ Tue 14 Jul, 2015, 14:31 ]
Post subject:  Rounding

Hi all !

For those wondering how to round a double variable, I'm attaching an example that rounds an indicator output to 2 digits. If you need more then change the divider (currently 100)
If you need to remove all the decimals, then simply assign your indicator's output to an "integer" variable freshly created.

Cheers!

Attachments:
Rounded2digits.vfs [15.66 KiB]
Downloaded 383 times

  Page 1 of 1