@@ -317,8 +317,8 @@ public Operand visitJudge_fun(final Judge_funContext context) {
317317 }
318318 } else if ((firstValue .Type () == OperandType .DATE && secondValue .Type () == OperandType .TEXT )
319319 || (secondValue .Type () == OperandType .DATE && firstValue .Type () == OperandType .TEXT )
320- || (firstValue .Type () == OperandType . NUMBER && secondValue .Type () == OperandType .TEXT )
321- || (secondValue .Type () == OperandType . NUMBER && firstValue .Type () == OperandType .TEXT )) {
320+ || (firstValue .Type (). isNumber () && secondValue .Type () == OperandType .TEXT )
321+ || (secondValue .Type (). isNumber () && firstValue .Type () == OperandType .TEXT )) {
322322 firstValue = firstValue .ToText ("Function '" + type + "' parameter 1 is error!" );
323323 if (firstValue .IsError ()) {
324324 return firstValue ;
@@ -443,7 +443,7 @@ public Operand visitISNUMBER_fun(final ISNUMBER_funContext context) {
443443 return firstValue ;
444444 }
445445
446- if (firstValue .Type () == OperandType . NUMBER ) {
446+ if (firstValue .Type (). isNumber () ) {
447447 return Operand .True ;
448448 }
449449 return Operand .False ;
@@ -520,7 +520,7 @@ public Operand visitISNULLORERROR_fun(final ISNULLORERROR_funContext context) {
520520
521521 public Operand visitISEVEN_fun (final ISEVEN_funContext context ) {
522522 final Operand firstValue = context .expr ().accept (this );
523- if (firstValue .Type () == OperandType . NUMBER ) {
523+ if (firstValue .Type (). isNumber () ) {
524524 if (firstValue .IntValue () % 2 == 0 ) {
525525 return Operand .True ;
526526 }
@@ -538,7 +538,7 @@ public Operand visitISLOGICAL_fun(final ISLOGICAL_funContext context) {
538538
539539 public Operand visitISODD_fun (final ISODD_funContext context ) {
540540 final Operand firstValue = context .expr ().accept (this );
541- if (firstValue .Type () == OperandType . NUMBER ) {
541+ if (firstValue .Type (). isNumber () ) {
542542 if (firstValue .IntValue () % 2 == 1 ) {
543543 return Operand .True ;
544544 }
@@ -2213,7 +2213,7 @@ public Operand visitTEXT_fun(final TEXT_funContext context) {
22132213 return firstValue ;
22142214 } else if (firstValue .Type () == OperandType .BOOLEAN ) {
22152215 return Operand .Create (firstValue .BooleanValue () ? "TRUE" : "FALSE" );
2216- } else if (firstValue .Type () == OperandType . NUMBER ) {
2216+ } else if (firstValue .Type (). isNumber () ) {
22172217 final DecimalFormat myFormatter = new DecimalFormat (secondValue .TextValue ());
22182218 return Operand .Create (myFormatter .format (firstValue .NumberValue ()));
22192219 } else if (firstValue .Type () == OperandType .DATE ) {
@@ -3178,7 +3178,7 @@ public Operand visitAVERAGEIF_fun(final AVERAGEIF_funContext context) {
31783178
31793179 double sum ;
31803180 int count ;
3181- if (args .get (1 ).Type () == OperandType . NUMBER ) {
3181+ if (args .get (1 ).Type (). isNumber () ) {
31823182 count = F_base_countif (list , args .get (1 ).NumberValue ());
31833183 sum = count * args .get (1 ).NumberValue ();
31843184 } else {
@@ -3303,7 +3303,7 @@ public Operand visitCOUNTIF_fun(final COUNTIF_funContext context) {
33033303 }
33043304
33053305 int count ;
3306- if (args .get (1 ).Type () == OperandType . NUMBER ) {
3306+ if (args .get (1 ).Type (). isNumber () ) {
33073307 count = F_base_countif (list , args .get (1 ).NumberValue ());
33083308 } else {
33093309 try {
@@ -3383,7 +3383,7 @@ public Operand visitSUMIF_fun(final SUMIF_funContext context) {
33833383 }
33843384
33853385 double sum ;
3386- if (args .get (1 ).Type () == OperandType . NUMBER ) {
3386+ if (args .get (1 ).Type (). isNumber () ) {
33873387 sum = F_base_countif (list , args .get (1 ).NumberValue ()) * args .get (1 ).NumberValue ();
33883388 } else {
33893389 if (Pattern .compile ("^-?(\\ d+)(\\ .\\ d+)?$" ).matcher (args .get (1 ).TextValue ().trim ()).find ()) {
@@ -4115,7 +4115,7 @@ private boolean F_base_compare(final double a, final double b, final String ss)
41154115
41164116 private boolean F_base_GetList_1 (final List <Operand > args , final List <Double > list ) {
41174117 for (final Operand item : args ) {
4118- if (item .Type () == OperandType . NUMBER ) {
4118+ if (item .Type (). isNumber () ) {
41194119 list .add (item .NumberValue ());
41204120 } else if (item .Type () == OperandType .ARRARY ) {
41214121 final boolean o = F_base_GetList_1 (item .ArrayValue (), list );
@@ -4146,7 +4146,7 @@ private boolean F_base_GetList_2(final Operand args, final List<Double> list) {
41464146 if (args .IsError ()) {
41474147 return false ;
41484148 }
4149- if (args .Type () == OperandType . NUMBER ) {
4149+ if (args .Type (). isNumber () ) {
41504150 list .add (args .NumberValue ());
41514151 } else if (args .Type () == OperandType .ARRARY ) {
41524152 final boolean o = F_base_GetList_1 (args .ArrayValue (), list );
@@ -5107,7 +5107,7 @@ public Operand visitVLOOKUP_fun(final VLOOKUP_funContext context) {
51075107 if (o .ArrayValue ().size () > 0 ) {
51085108 final Operand o1 = o .ArrayValue ().get (0 );// [0];
51095109 int b = -1 ;
5110- if (secondValue .Type () == OperandType . NUMBER ) {
5110+ if (secondValue .Type (). isNumber () ) {
51115111 final Operand o2 = o1 .ToNumber (null );
51125112 if (o2 .IsError () == false ) {
51135113 b = Compare (o2 .NumberValue (), secondValue .NumberValue ());
@@ -5140,7 +5140,7 @@ public Operand visitVLOOKUP_fun(final VLOOKUP_funContext context) {
51405140 if (o .ArrayValue ().size () > 0 ) {
51415141 final Operand o1 = o .ArrayValue ().get (0 );// [0];
51425142 int b = -1 ;
5143- if (secondValue .Type () == OperandType . NUMBER ) {
5143+ if (secondValue .Type (). isNumber () ) {
51445144 final Operand o2 = o1 .ToNumber (null );
51455145 if (o2 .IsError () == false ) {
51465146 b = Compare (o2 .NumberValue (), secondValue .NumberValue ());
0 commit comments