# Number formats 50 -&gt; 0.0005

19

I'm trying to convert a whole number of pips to the correct price value. For example I want to be able to enter '50' and the function output 0.0005. To do this the maths is simple - 50 / 100000 (this is for a broker giving prices accurate to 5 decimal places of course) now the output is technically correct - 1e-005 but when I try to add this to a price to determine stop levels for example I get a 130 ERR_INVALID_STOPS. Any ideas? Thanks.

UPDATE: When I do 50.0 / 100000 I get the correct, usable answer = 0.0005
ABOVE 50.0 instead of 50, just in case you missed it!
BUT: When I do 3.0 / 100000 I get the useless 3e-005 instead of 0.00003
225

are you sure you put all zeros correctly? try     3 * Point   instead and make sure you add the obtained value to a correct price value(your value is correct if you get it from some price, ie low or high or close of some bar, it is incorrect if you get it from manually installed horizontal line or from the average(and other operations with dividing) of two or more prices. you can also make your values acceptable by NormalizeDouble(value, Digits)
Moderator
10564

BUT: When I do 3.0 / 100000 I get the useless 3e-005 instead of 0.00003

It is not useless. I guess that you are probably printing the value?

`  Print( 3.0 / 100000);`

Will print  3e-005

If you want to see it in a more recognisable form

`  Print( DoubleToStr(3.0 / 100000,Digits));`

but it is the same value