fix use REGEX_SCIENTIFIC

pull/5370/head
yann300 2 years ago committed by Aniket
parent a0eb8e17f3
commit 3274f69185
  1. 4
      libs/remix-lib/src/execution/txFormat.ts

@ -478,6 +478,7 @@ export const normalizeParam = (param) => {
if (/[0-9]/g.test(param)) param = `${param}`
// fromExponential
if (!param.startsWith('0x')) {
const regSci = REGEX_SCIENTIFIC.exec(param)
const exponents = regSci ? regSci[2] : null
if (regSci && REGEX_DECIMAL.exec(exponents)) {
@ -489,6 +490,7 @@ export const normalizeParam = (param) => {
console.log(e)
}
}
}
if (typeof param === 'string') {
if (param === 'true') param = true
@ -497,7 +499,7 @@ export const normalizeParam = (param) => {
return param
}
export const REGEX_SCIENTIFIC = /(\d+\.?\d*)e\d*(\d+)/;
export const REGEX_SCIENTIFIC = /^(\d+\.?\d*)e\d*(\d+)$/
export const REGEX_DECIMAL = /^\d*/

Loading…
Cancel
Save