← Back to team overview

dhis2-devs team mailing list archive

Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 1337: Improved DataValue.isZero

 

================================
Tran Thanh Tri
 HISP Viet Nam
 Cell phone: +84903670967
 Website: http://tringuyenvn.com
================================


2010/1/25 <noreply@xxxxxxxxxxxxx>

> ------------------------------------------------------------
> revno: 1337
> committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
> branch nick: trunk
> timestamp: Mon 2010-01-25 15:30:51 +0100
> message:
>  Improved DataValue.isZero
> modified:
>  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
>
>
> --
> lp:dhis2
> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
>
> Your team DHIS 2 developers is subscribed to branch lp:dhis2.
> To unsubscribe from this branch go to
> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
> .
>
> === modified file
> 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java'
> --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
>      2010-01-25 14:08:24 +0000
> +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
>      2010-01-25 14:30:51 +0000
> @@ -198,7 +198,7 @@
>     public boolean isZero()
>     {
>         return dataElement != null && dataElement.getType().equals(
> DataElement.VALUE_TYPE_INT )
> -            && value != null && ( value.equals( "0" ) || value.startsWith(
> "0." ) );
>
 This script will not working fine. *new Double("0.001").intValue()==0 is
true but it must be false.*
 I thing it must be n*ew Double(value)==(new Double(0))*
what do you thing ?

+            && value != null && new Double( value ).intValue() == 0;
>     }
>
>     public boolean isNullValue()
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References