sending an order through BTC-e API incorrect field error I get the following message when trying to send a buy/sell order through btc-e api using a variable:
"you incorrectly entered one of the fields". 

This is the line of code I use for sending an order:

APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, Math.Round(myAskP, 4), Math.Round(myAskQ, 4));


Sending an order via api does work when I enter it like this:

APIMain.Trade(BtcePair.BtcUsd, TradeType.Sell, 800m, 0.5m);


How do I force a decimal variable to be formatted like the line above?
Anybody experienced similar problems?
The exact problem you're facing regards the number of acceptable decimal digits in the rate field.

You're trying to submit an order on the BTC/USD pair, which happens to have a max decimal allotment of 3. Meaning, you can submit an order for example 800.123, but NOT 800.1234 Not all pairs are the same. LTC/USD can have 6 digits, most BTC based pairs can accept 5 digits.

To get a list of exact information regarding the individual pairs, use this public endpoint for a JSON object that gives you all the values:  https://btc-e.com/api/3/info

As far as I know, all pairs' amount fields can have a max of 8 decimals. You are rounding both the amount and rate to 4 digits. Fix the rate field and it should work.

Please keep in mind when I say "decimal places" I mean actual number of digits after the period in a number. Not the numerical type decimal that you are using. Using a double or float will work as well, provided they are rounded properly.