Firebot icon indicating copy to clipboard operation
Firebot copied to clipboard

fix: ensure number ignoring string empty

Open CKY- opened this issue 1 year ago • 0 comments

Description of the Change

added check for if not string empty because Number('') = 0 and is finite would return 0 ignoring the default out

Applicable Issues

#2522

Testing

ran tests for

current behavior $ensureNumber[$arg[1],1] = 0 $ensureNumber[test,1] = 1 $ensureNumber[$null,1] = 0 $ensureNumber[20,1] = 20 expected

$ensureNumber[$arg[1],1] = 1 $ensureNumber[test,1] = 1 $ensureNumber[$null,1] = 1 $ensureNumber[20,1] = 20

Screenshots

CKY- avatar Apr 23 '24 07:04 CKY-