An old professor asked me this question at the gym today: If I give you 1 US penny (1/100th of a dollar) today and you double the result every day for 30 days only, how much money will you end up with at the end of the 30 days? I answered: I have no idea, but I will write a little B4A code after the workout and get back to you tomorrow with the result.
I wrote these few lines of code and to my astonishment it is over $10,000,000. If you disagree or have a better way to achieve the result, please post it:
I wrote these few lines of code and to my astonishment it is over $10,000,000. If you disagree or have a better way to achieve the result, please post it:
B4X:
Dim x As Long =1
For i= 0 To 30-1
x=x*2
Next
Dim y As String = NumberFormat2(x/100,1,0,0,True)
LogColor(y, Colors.Red) 'displays: 10,737,418