Skip to content

Commit

Permalink
fix precision (paritytech#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
toxotguo authored Nov 23, 2018
1 parent 916ddf3 commit 5c31947
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cxrml/exchange/pendingorders/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ impl<T: Trait> Module<T> {
<LastAveragePrice<T>>::insert(pair.clone(), price);
}
Some(p) => {
match Self::pair_detail_of(pair.clone()) {
Some(order_pair_detail) => {
match <tokenbalances::Module<T>>::token_info(pair.second.clone()) {
Some((token,_)) => {
let average_sum: T::Amount = As::sa(
10_u128.pow(order_pair_detail.precision.as_())
10_u128.pow(token.precision().as_())
* Self::average_price_len().as_(),
); //将精度考虑进去
let last_average_price: T::Price = As::sa(
Expand Down

0 comments on commit 5c31947

Please sign in to comment.