J JogiDroid Member Licensed User Longtime User Jan 15, 2011 #1 Started thread in elsewhere as I was thinking it must be me, b4a newbie... but instead it seems b4a has some internal bug when converting Long to string. ----- Try this: Dim expiryTime As Long Dim testString As String expiryTime = 14400000 Log("expiryTime: " & expiryTime) Label1.Text = expiryTime testString = expiryTime Log("testString1: " & testString) testString = Label1.Text Log("testString2: " & testString) And you get: expiryTime: 1.44E7 testString1: 1.44E7 testString2: 14400000 ------------------------ And digging from main.java I found: _teststring = BA.NumberToString(_expirytime); That seems to work with Int but not with Long (uses wrong format with Long?)
Started thread in elsewhere as I was thinking it must be me, b4a newbie... but instead it seems b4a has some internal bug when converting Long to string. ----- Try this: Dim expiryTime As Long Dim testString As String expiryTime = 14400000 Log("expiryTime: " & expiryTime) Label1.Text = expiryTime testString = expiryTime Log("testString1: " & testString) testString = Label1.Text Log("testString2: " & testString) And you get: expiryTime: 1.44E7 testString1: 1.44E7 testString2: 14400000 ------------------------ And digging from main.java I found: _teststring = BA.NumberToString(_expirytime); That seems to work with Int but not with Long (uses wrong format with Long?)
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2011 #2 This is a bug. The long value is mistakenly converted to double. A fix is available here: http://www.b4x.com/forum/basic4andr...rials/7347-fix-long-string-bug.html#post41941
This is a bug. The long value is mistakenly converted to double. A fix is available here: http://www.b4x.com/forum/basic4andr...rials/7347-fix-long-string-bug.html#post41941