NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 01-02-2008, 08:39 PM   #1
Burga1
Senior Member
 
Join Date: Nov 2007
Posts: 388
Thanks: 0
Thanked 0 times in 0 posts
Default Rounding off to an integer?

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.
Burga1 is offline  
Reply With Quote
Old 01-02-2008, 10:20 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Please check out Math.Floor and Math.Ceiling like
int intValue = (int) Math.Floor(doubleValue);

Please consult Microsoft documentation for details on these methods.
NinjaTrader_Dierk is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 12:14 PM.