Fixed issue with parsing of trade price.

The + operator has higher precedence, which causes the price to be read
as '' (empty string) no matter what the currency and issuer.

I believe this will fix the "Last price = n/a" error in the default
client as well.
This commit is contained in:
Manish Jethani
2013-10-05 07:16:29 +05:30
parent b4c120cea4
commit f077624212

View File

@@ -137,9 +137,9 @@ OrderBook.prototype.is_valid = function () {
OrderBook.prototype.trade = function(type) {
var tradeStr = '0'
+ (this['_currency_' + type] === 'XRP') ? '' : '/'
+ ((this['_currency_' + type] === 'XRP') ? '' : '/'
+ this['_currency_' + type ] + '/'
+ this['_issuer_' + type];
+ this['_issuer_' + type]);
return Amount.from_json(tradeStr);
};