diff options
Client side error handling for from, to and amount fields in send.js
Diffstat (limited to 'ui/app/conversion-util.js')
-rw-r--r-- | ui/app/conversion-util.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js index 0ede77487..7e02fe2bd 100644 --- a/ui/app/conversion-util.js +++ b/ui/app/conversion-util.js @@ -123,7 +123,20 @@ const addCurrencies = (a, b, { toNumericBase, numberOfDecimals }) => { }) } +const conversionGreaterThan = ( + { value, fromNumericBase }, + { value: compareToValue, fromNumericBase: compareToBase }, +) => { + const firstValue = converter({ value, fromNumericBase }) + const secondValue = converter({ + value: compareToValue, + fromNumericBase: compareToBase, + }) + return firstValue.gt(secondValue) +} + module.exports = { conversionUtil, addCurrencies, + conversionGreaterThan, }
\ No newline at end of file |