E Edgardo PuntoCom Member Licensed User Longtime User Jun 16, 2014 #1 I'm doing a unit converter. If I write: B4X: Msgbox(5 * 0.000001,"") The result shown on screen is: 4.9999999999999996E-6 Why not show: 5.0E-6?
I'm doing a unit converter. If I write: B4X: Msgbox(5 * 0.000001,"") The result shown on screen is: 4.9999999999999996E-6 Why not show: 5.0E-6?
LucaMs Expert Licensed User Longtime User Jun 16, 2014 #2 I tried taking off a zero and the result is the expected one (I used variables of type double). Evidently, the "precision" does not come to that number of decimals. Upvote 0
I tried taking off a zero and the result is the expected one (I used variables of type double). Evidently, the "precision" does not come to that number of decimals.
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2014 #3 Use NumberFormat to convert the number to string. B4X: Log(NumberFormat(5 * 0.000001, 0, 7)) Upvote 0