I have a rounded float variable (in debugger I see it as 7.908), and I show
result in two labels, but I receive different results:
:BangHead: Why?
test code is attached
Upd.
It works correctly, but the situation which I described above is unclear for me...
result in two labels, but I receive different results:
B4X:
Sub btCalc_Click
Dim Rez As Float
Rez = Round2(7.907999456789, 3) ' Rez debugger shows as "7.908"
lbResult2.Text = Rez ' shows as "7.908"
lbResult.Text = Rez & " mV" ' shows as "7.907999456789 mV"
End Sub
:BangHead: Why?
test code is attached
Upd.
B4X:
lbResult.Text = NumberFormat(Rez, 0, 3) & " mV"
Attachments
Last edited: