Mark decimal places

This commit is contained in:
Daniel Pyrathon 2020-10-05 17:36:52 -07:00
parent efef5f122f
commit dde76a4dbb
2 changed files with 3 additions and 1 deletions

View File

@ -221,3 +221,4 @@ export const ONE_HOUR_IN_SECONDS = 60 * 60;
export const ONE_SECOND_MS = 1000; export const ONE_SECOND_MS = 1000;
export const NULL_BYTES = '0x'; export const NULL_BYTES = '0x';
export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000'; export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
export const COMPARISON_PRICE_DECIMALS = 5;

View File

@ -11,6 +11,7 @@ import { QuoteRequestor } from '../quote_requestor';
import { generateQuoteReport, QuoteReport } from './../quote_report_generator'; import { generateQuoteReport, QuoteReport } from './../quote_report_generator';
import { import {
BUY_SOURCE_FILTER, BUY_SOURCE_FILTER,
COMPARISON_PRICE_DECIMALS,
DEFAULT_GET_MARKET_ORDERS_OPTS, DEFAULT_GET_MARKET_ORDERS_OPTS,
FEE_QUOTE_SOURCES, FEE_QUOTE_SOURCES,
ONE_ETHER, ONE_ETHER,
@ -608,7 +609,7 @@ export class MarketOperationUtils {
if (totalMakerAmount.gt(0)) { if (totalMakerAmount.gt(0)) {
const totalMakerAmountUnitAmount = Web3Wrapper.toUnitAmount(totalMakerAmount, marketSideLiquidity.makerTokenDecimals); const totalMakerAmountUnitAmount = Web3Wrapper.toUnitAmount(totalMakerAmount, marketSideLiquidity.makerTokenDecimals);
const totalTakerAmountUnitAmount = Web3Wrapper.toUnitAmount(totalTakerAmount, marketSideLiquidity.takerTokenDecimals); const totalTakerAmountUnitAmount = Web3Wrapper.toUnitAmount(totalTakerAmount, marketSideLiquidity.takerTokenDecimals);
comparisonPrice = totalTakerAmountUnitAmount.div(totalMakerAmountUnitAmount); comparisonPrice = totalMakerAmountUnitAmount.div(totalTakerAmountUnitAmount).decimalPlaces(COMPARISON_PRICE_DECIMALS);
} }
} }