I'm wanting to show a number in an Edittext as x.xx with 2 decimal point values shown all the time
e.g 1.00, 0.96, 0.90, etc
With the following code I get:
1.0, 0.99, 0.98, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.9, .......
How comes 2 decimal places are not show each time?
Thanks
e.g 1.00, 0.96, 0.90, etc
With the following code I get:
1.0, 0.99, 0.98, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.9, .......
B4X:
Sub btnShadeDown_Click
If txtShade.Text > 0 Then
Dim NewShade As Double = NumberFormat2((txtShade.Text - 0.01), 0, 2, 2, False)
Log(NewShade)
txtShade.Text = NewShade
End If
End Sub
How comes 2 decimal places are not show each time?
Thanks