Skip to content

Commit

Permalink
Update evaluator.js
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Nov 15, 2024
1 parent 2dec49e commit 7ac4799
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utils/ADempiere/contextUtils/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,18 @@ export class evaluator {
// if both values are empty, but not equal (" ", NaN, null, undefined)
const isBothEmptyValues = isEmptyValue(value1) && isEmptyValue(value2)

// parse to number to evaluate "0" with "0.00"
// parse to number to evaluate `0` number with `"0.00"` string
if (!Number.isNaN(value1)) {
const convertedNumber1 = Number(value1)
if (!isEmptyValue(convertedNumber1)) value1 = convertedNumber1
if (!isEmptyValue(convertedNumber1)) {
value1 = convertedNumber1
}
}
if (!Number.isNaN(value2)) {
const convertedNumber2 = Number(value2)
if (!isEmptyValue(convertedNumber2)) value2 = convertedNumber2
if (!isEmptyValue(convertedNumber2)) {
value2 = convertedNumber2
}
}
let isValueLogic
switch (operand) {
Expand Down

0 comments on commit 7ac4799

Please sign in to comment.