Skip to content

Commit

Permalink
Cleanup: reduce helpers/math (#3511)
Browse files Browse the repository at this point in the history
  • Loading branch information
iower committed Nov 28, 2020
1 parent de1a847 commit 9e3181b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,26 @@ import Toggle from 'components/controls/Toggle/Toggle'
import Input from 'components/forms/Input/Input'
import Tooltip from 'components/ui/Tooltip/Tooltip'
import { FormattedMessage } from 'react-intl'
import { isNumberValid, isNumberStringFormatCorrect, mathConstants } from 'helpers/math'
import minAmountOffer from 'helpers/constants/minAmountOffer'
import coinsWithDynamicFee from 'helpers/constants/coinsWithDynamicFee'


const mathConstants = {
high_precision: 10e-8,
low_precision: 10e-5,
}

const isNumberStringFormatCorrect = number => {
const stringified = String(number)

const firstDotIndex = stringified.indexOf('.')
const lastDotIndex = stringified.lastIndexOf('.')

// first and last dot positions match, so it has only one dot
return firstDotIndex === lastDotIndex
}


const isDark = localStorage.getItem(constants.localStorage.isDark)
@connect(
({
Expand Down
47 changes: 0 additions & 47 deletions src/front/shared/helpers/math.ts

This file was deleted.

0 comments on commit 9e3181b

Please sign in to comment.