Skip to content

Commit

Permalink
prevent scientific number
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed May 13, 2024
1 parent 37b5569 commit 3cf448c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/simulator/input/SimInputChart.tsx
Expand Up @@ -24,6 +24,7 @@ import { ReactComponent as IconPlus } from 'assets/icons/plus.svg';
import { CandlestickData, D3ChartSettingsProps, D3ChartWrapper } from 'libs/d3';
import { fromUnixUTC, toUnixUTC } from '../utils';
import { startOfDay, sub } from 'date-fns';
import { formatNumber } from 'utils/helpers';

interface Props {
state: StrategyInputValues | SimulatorInputOverlappingValues;
Expand Down Expand Up @@ -75,20 +76,20 @@ export const SimInputChart = ({

const onPriceUpdates: OnPriceUpdates = useCallback(
({ buy, sell }) => {
dispatch('buyMin', buy.min, false);
dispatch('buyMax', buy.max, false);
dispatch('sellMin', sell.min, false);
dispatch('sellMax', sell.max, false);
dispatch('buyMin', formatNumber(buy.min), false);
dispatch('buyMax', formatNumber(buy.max), false);
dispatch('sellMin', formatNumber(sell.min), false);
dispatch('sellMax', formatNumber(sell.max), false);
},
[dispatch]
);

const onPriceUpdatesEnd: OnPriceUpdates = useCallback(
({ buy, sell }) => {
dispatch('buyMin', buy.min);
dispatch('buyMax', buy.max);
dispatch('sellMin', sell.min);
dispatch('sellMax', sell.max);
dispatch('buyMin', formatNumber(buy.min));
dispatch('buyMax', formatNumber(buy.max));
dispatch('sellMin', formatNumber(sell.min));
dispatch('sellMax', formatNumber(sell.max));
},
[dispatch]
);
Expand Down

0 comments on commit 3cf448c

Please sign in to comment.