How can I compare two properties with numeric values?

前端 未结 3 1253
一个人的身影
一个人的身影 2021-01-05 21:21

How can I find out which of two numeric properties is the greatest?

Here\'s how to check wheather two are equal:



        
3条回答
  •  再見小時候
    2021-01-05 21:50

    If you don't want to (or cannot) use the Ant-Contrib libraries, you can define a compare task using javascript:

    
    
    
        
        
        
         val2 ? 1 : (val1 < val2 ? -1 : 0));
        project.setProperty(attributes.get("result"), result);
        ]]>
    
    

    You can use it like this:

    
    ...
    
    
    
        
            
        
    
    

提交回复
热议问题