maulaku / wwdiary

Automatically exported from code.google.com/p/wwdiary
0 stars 0 forks source link

Food information 0 by default #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a new item, say "candy"
2. Add "carbs: 15g". Leaves the rest blank
3. Points display 0, when all fields are not filled

What is the expected output? What do you see instead?
An empty field should be 0 by default.

What version of WWDiary are you using (check the "what's new" screen)?
6.4.4

What version of Android are you running?
4

What device do you have (phone/tablet)?  What brand/model?
Nexus S

Please provide any additional information below.

Original issue reported on code.google.com by nui...@gmail.com on 22 Aug 2012 at 8:16

GoogleCodeExporter commented 9 years ago
I'll have to think about this one.   Technical limitations may prevent me from 
doing it.   Having unspecified fields allows me to detect when I have 
incomplete nutrition information.  Assuming they are all zero might mess some 
things up when nutrition can only be partially obtained when doing lookups with 
the paid barcode scanning feature.

Original comment by ddumont on 22 Aug 2012 at 8:34

GoogleCodeExporter commented 9 years ago
I don't think I'll be able to do this one.  I tries a few scenarios, and I rely 
too much on blank info being un-entered. If feilds are 0 right now, they are 
assumed to be intentionally zero and not zero by default because someone didn't 
enter it or forgot to or missed it or something.

Original comment by ddumont on 12 Nov 2012 at 12:40

GoogleCodeExporter commented 9 years ago
Sure, no problem. Just to get that off my mind though I am no developer, I may 
have been too directive in stating zero should be a default value. A better 
solution would be to leave the field blank, but compute zero in the points 
calculation formula when the field is blank, maybe by doubling each field with 
a corresponding point equivalent field. 
In the example above: carbs would have a hidden "carb points" field, say 1.5, 
while "fat points" would compute zero without having to modify the original 
blank field. The food points calculator would then sum these fields and do 
whatever rounding is necessary. I understand this would wreck the "input your 
own formula" feature though, but I doubt anyone uses it anyway. 
Just food for thought (pun intended), great application otherwise.

Original comment by nui...@gmail.com on 12 Nov 2012 at 3:04