dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35203
Re: Rounding of numbers in tracker
Wouldn’t it make sense to follow the Java convention so at least there is a clear way to understand what “number” means?
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html <http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html>
> On Jan 20, 2015, at 12:57 PM, Jason Pickering <jason.p.pickering@xxxxxxxxx> wrote:
>
> Dunno. Floating point sounds much geekier than "real number", although it is of course technically more correct. Maybe "Decimal number"?
>
> I think the more problematic issue is the API and how decimals appear to be "int", which led to this bug, which of course is misleading.
>
> Regards,
> Jason
>
>
> On Tue, Jan 20, 2015 at 4:12 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx <mailto:bobjolliffe@xxxxxxxxx>> wrote:
> I think Jason's suggestion makes good sense. It doesn't make intuitive sense that people should interpret Number to mean real number as distinct to integer. Though maybe "real number" is slightly too mathematical a term for some users. I wonder is "floating point" less technical or moreso? Either way lets try and agree on an alternative to just Number.
>
> On 20 January 2015 at 13:17, Abyot Gizaw <abyota@xxxxxxxxx <mailto:abyota@xxxxxxxxx>> wrote:
> Yes kind of confusing ... that is why I ended up with the bug. Since I was getting int through the web-api, I simply used parseInt ... hence the rounding.
>
>
> ---
> Thank you,
> Abyot.
>
> On Tue, Jan 20, 2015 at 1:58 PM, Jason Pickering <jason.p.pickering@xxxxxxxxx <mailto:jason.p.pickering@xxxxxxxxx>> wrote:
> Hi Abyot,
> Thanks for the quick fix.
>
> It is a bit confusing from the API I must admit. In the UI, these data elements are defined as "Value type" = Number and Number type = "Number", but in the API JSON response, it comes out as "int" for the "type".
>
> It might be work considering to change the Number type to "Real" instead of "Number". It is fairly obvious it is a number. :)
>
> Regards,
> Jason
>
>
> On Tue, Jan 20, 2015 at 12:47 PM, Abyot Gizaw <abyota@xxxxxxxxx <mailto:abyota@xxxxxxxxx>> wrote:
> Hi Jason,
>
> Yes, they were converted to Integer. This is fixed now in trunk.
>
> ---
> Thank you,
> Abyot.
>
> On Tue, Jan 20, 2015 at 12:03 PM, Jason Pickering <jason.p.pickering@xxxxxxxxx <mailto:jason.p.pickering@xxxxxxxxx>> wrote:
> Hi Devs,
> We have some data values which are numerically precise to two decimal places. In the trackedentitydatavalue table, the numbers are correct as they should be, but in the UI, they appear to be truncated or possibly rounded to the nearest integer. Could someone confirm this is the case? If so, I think it is a bug, as the data elements have been defined to be numeric, and not integers.
>
> Best regards,
> Jason
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx <mailto:jason.p.pickering@xxxxxxxxx>
> tel:+46764147049 <tel:%2B46764147049>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx <mailto:jason.p.pickering@xxxxxxxxx>
> tel:+46764147049 <tel:%2B46764147049>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx <mailto:jason.p.pickering@xxxxxxxxx>
> tel:+46764147049
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
Follow ups
References