Bug? Google Pixel XL and DipToCurrent Problem

Jack Cole

Well-Known Member
Licensed User
Longtime User
I am having a problem with using DipToCurrent with the Google Pixel phone (Android 7).

Here are some values as calculated by the app.

DipToCurrent(1)=3
DipToCurrent(2)=7
DipToCurrent(3)=10

1dip=3
2dip=6
3dip=9

On other devices, I do not get different values like above with DipToCurrent and dip.
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
Ok, my post above was in error.

The dip values are the same as DipToCurrent.

1dip=3
2dip=7
3dip=10
100dip=350

I was doing 1*1dip, 2*1dip, etc.. So, 100*1dip=300, but 100dip=350 and DipToCurrent(100)=350. Still does not seem right to me, but it is more comprehensible.
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
Ok. For others who try to convert to to dip, do not use x / DipToCurrent(1). This can give incorrect results depending on how DipToCurrent(1) is rounded compared to how other values are rounded.
 
Top