[TIMOB-3335] Android: Loss of precision with properties setDouble call
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-11-05T13:40:14.000+0000 |
Affected Version/s | Release 1.6.2 |
Fix Version/s | Sprint 2011-24, Release 1.7.2, Release 1.8.0 |
Components | Android |
Labels | n/a |
Reporter | Andreas sandberg |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:42:27.000+0000 |
Updated | 2011-11-05T13:40:14.000+0000 |
Description
For droid, the following example fails as the setDouble and getDouble function convert the double to float and loss of precision occurs:
var now = new Date();
var a = now.getTime();
Ti.App.Properties.setDouble('SessionIDTimeStamp', a );
var b = Ti.App.Properties.getDouble('SessionIDTimeStamp');
Ti.API.error("After: " + Ti.App.Properties.getDouble('SessionIDTimeStamp'));
if(a == b)
{
Ti.API.error("They are equal.");
}
else
{
Ti.API.error("They are not equal.....???");
}
here's the pull request for the fix: https://github.com/appcelerator/titanium_mobile/pull/79">https://github.com/appcelerator/titanium_mobile/pull/79 .
Converted functional test to drillbit test, made formatting changes, merged pull request.
merged to 1_7_X
Tested with 1.7.2.v20110706211037 on Droid 2.2.1 and emulator 2.3.3
Fixing labels.