(1100/2000) should not equal 0

 

What is wrong here?

The result should be 0.55 however I get 0.

 

Alert( 1100 / 2000 );
Alert( NormalizeDouble((1100 / 2000),2) );

 
hknight:

What is wrong here?

The result should be 0.55 however I get 0.

 


Lack of decimal infers int I think. Simply add a decimal like the following:

Alert( 1100.0 / 2000.0 );
Alert( NormalizeDouble((1100.0 / 2000.0),2) );
 

Thanks!

 How can I do that with numbers that are pre-defined?

Alert(  MathFloor(AccountEquity()/AccountBalance())  ); 
 
Paul_B:

Lack of decimal infers int I think. Simply add a decimal like the following:

Correct,  it's Type casting.
 
hknight:

Thanks!

 How can I do that with numbers that are pre-defined?

Alert(  MathFloor(AccountEquity()/AccountBalance())  ); 

AccountEquity() and AccountBalance() are functions that return values which are double data type, so you shouldn't see the same typecasting issue as you did in your original post.
 

Great, thanks!

Reason: