Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

[FIX] Advanced trade: fix values calculations #2417

Merged
merged 1 commit into from
Apr 29, 2015

Conversation

darkdarkdragon
Copy link
Contributor

Do not convert amount and order values to number
when assigning to input - because chrome and IE shows
big/small numbers in input in scientific notation

use "replace(/,/g, '')" on result of "to_text_full()"
until ripple lib fixed - "to_text_full()" returns
string with group separator

@vhpoet
Copy link
Contributor

vhpoet commented Apr 16, 2015

until ripple lib fixed - "to_text_full()" returns

@geertweening @clark800 do you guys know what needs to be fixed?

@clark800
Copy link

He's referring to this pull request: XRPLF/xrpl.js#326

@darkdarkdragon
Copy link
Contributor Author

@vhpoet just come to my mind - why to_text_full was used here in the first place?
Anyway result is going to from_json, so why not just use from_json?

Do not convert amount and order values to number
when assigning to input - because chrome and IE shows
big/small numbers in input in scientific notation

use "replace(/,/g, '')" on result of "to_text_full()"
until ripple lib fixed - "to_text_full()" returns
string with group separator
@@ -834,7 +836,7 @@ TradeTab.prototype.angular = function(module)
if (order.price_amount && order.price_amount.is_valid() &&
order.first_amount && order.first_amount.is_valid()) {
order.second_amount = order.price_amount.product_human(order.first_amount);
order.second = +order.second_amount.to_human({group_sep: false});
order.second = order.second_amount.to_human({group_sep: false});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the + killed? It's a conversion to number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jublo That was whole point of this commit. This value goes into input field. And when it is number, chrome shows it in e-notation if it too small or too big

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. Well done then.

@vhpoet
Copy link
Contributor

vhpoet commented Apr 29, 2015

LGTM

1 similar comment
@mrajvanshy
Copy link
Contributor

LGTM

mrajvanshy added a commit that referenced this pull request Apr 29, 2015
[FIX] Advanced trade: fix values calculations
@mrajvanshy mrajvanshy merged commit 67fe91a into ripple:develop Apr 29, 2015
@darkdarkdragon darkdarkdragon deleted the develop-fix-trade-input branch April 30, 2015 21:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants