![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
How is it possible to "round off"? What I would normally do is simply set a value using an "integer" command, for example: value = int(value2); //sets value to the integer calculation of value2... however in NT this has a different reserved purpose...thus this is not an option...thanks in advance. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Please check out Math.Floor and Math.Ceiling like
int intValue = (int) Math.Floor(doubleValue); Please consult Microsoft documentation for details on these methods.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error combining ema with an integer | Thomas | Strategy Development | 3 | 08-16-2007 05:40 AM |