Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Why 1/10 prints as zero?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Why 1/10 prints as zero?

    It was while I've last coded indicator, so today, i am testing (with latest NT) in indicator:
    Print(1/10);

    and it prints as 0 in Output Window. also does Print(1/10 *100); too. What is the reason?

    #2
    Hello ttodua,

    Thanks for your post.

    The numbers are entered as integers so the results would be integers (whole numbers)

    You would need to add a decimal point to get a double value printed (1.0/10.0), etc.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tsantospinto, 04-12-2024, 07:04 PM
    4 responses
    61 views
    0 likes
    Last Post aligator  
    Started by michi08, 10-05-2018, 09:31 AM
    3 responses
    740 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by sightcareclickhere, Today, 01:55 PM
    0 responses
    1 view
    0 likes
    Last Post sightcareclickhere  
    Started by Mindset, 05-06-2023, 09:03 PM
    9 responses
    259 views
    0 likes
    Last Post ender_wiggum  
    Started by Mizzouman1, Today, 07:35 AM
    4 responses
    18 views
    0 likes
    Last Post Mizzouman1  
    Working...
    X