File tree Expand file tree Collapse file tree 5 files changed +25
-1
lines changed
test/test-suite/groups/function-number Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1194,7 +1194,7 @@ const functions = (() => {
11941194 if ( typeof arg === 'number' ) {
11951195 // already a number
11961196 result = arg ;
1197- } else if ( typeof arg === 'string' && / ^ - ? ( 0 | ( [ 1 - 9 ] [ 0 - 9 ] * ) ) ( \. [ 0 - 9 ] + ) ? ( [ E e ] [ - + ] ? [ 0 - 9 ] + ) ? $ / . test ( arg ) && ! isNaN ( parseFloat ( arg ) ) && isFinite ( arg ) ) {
1197+ } else if ( typeof arg === 'string' && / ^ - ? [ 0 - 9 ] + ( \. [ 0 - 9 ] + ) ? ( [ E e ] [ - + ] ? [ 0 - 9 ] + ) ? $ / . test ( arg ) && ! isNaN ( parseFloat ( arg ) ) && isFinite ( arg ) ) {
11981198 result = parseFloat ( arg ) ;
11991199 } else if ( arg === true ) {
12001200 // boolean true casts to 1
Original file line number Diff line number Diff line change 1+ {
2+ "expr" : " $number('00')" ,
3+ "dataset" : null ,
4+ "bindings" : {},
5+ "result" : 0
6+ }
Original file line number Diff line number Diff line change 1+ {
2+ "expr" : " $number('0123')" ,
3+ "dataset" : null ,
4+ "bindings" : {},
5+ "result" : 123
6+ }
Original file line number Diff line number Diff line change 1+ {
2+ "expr" : " $number('-007')" ,
3+ "dataset" : null ,
4+ "bindings" : {},
5+ "result" : -7
6+ }
Original file line number Diff line number Diff line change 1+ {
2+ "expr" : " $number('000.00123000')" ,
3+ "dataset" : null ,
4+ "bindings" : {},
5+ "result" : 0.00123
6+ }
You can’t perform that action at this time.
0 commit comments