user18399: I started writing code for the Bitfinex api yesterday and I've been struggling quite a lot with this.
I am using jndok's python implementation. 
I added my pyblic and secret keys and wrote this line of code at the end with python 2.7 on Windows 8:
rep = place_order(0.001, 589.0, 'sell', 'limit', exchange='bitfinex')

And I thought that would do it but the reply I get 'Key amount should be a decimal string' and the order is not placed.
I also tried to print the reply code I get from the server and it is 400.
How can this be resolved?

user17113: You are submitting a float value. Float values are not totaly accurate:
>>> 0.9 
0.90000000000000002

Thats why the specification requires a Decimal datatype:
>>> from decimal import Decimal
>>> Decimal("0.001") 


18399: <p>I started writing code for the Bitfinex api yesterday and I've been struggling quite a lot with this.
I am using jndok's <a href="http://jndok.net/bitfinexapi.html" rel="nofollow">python implementation</a>. </p>

<p>I added my pyblic and secret keys and wrote this line of code at the end with python 2.7 on Windows 8:</p>

<pre><code>rep = place_order(0.001, 589.0, 'sell', 'limit', exchange='bitfinex')
</code></pre>

<p>And I thought that would do it but the reply I get 'Key amount should be a decimal string' and the order is not placed.
I also tried to print the reply code I get from the server and it is 400.</p>

<p>How can this be resolved?</p>
 17113: <p>You are submitting a float value. Float values are not totaly accurate:</p>

<pre><code>&gt;&gt;&gt; 0.9 
0.90000000000000002
</code></pre>

<p>Thats why the <a href="https://www.bitfinex.com/pages/api" rel="nofollow">specification</a> requires a <a href="https://docs.python.org/2/library/decimal.html" rel="nofollow">Decimal datatype</a>:</p>

<pre><code>&gt;&gt;&gt; from decimal import Decimal
&gt;&gt;&gt; Decimal("0.001") 
</code></pre>
