Colin Evans Active Member Licensed User Longtime User May 12, 2020 #1 I've searched but couldn't find the answer so please help I have two labels containing a numeric value i.e. lblA.text = "2.14" lblB.text = "7.35" i want to be able to multiply them together and then put the resulting value in lblC.text = "15.73" , and round the result up to two decimal places, hope you can point me in the right direction
I've searched but couldn't find the answer so please help I have two labels containing a numeric value i.e. lblA.text = "2.14" lblB.text = "7.35" i want to be able to multiply them together and then put the resulting value in lblC.text = "15.73" , and round the result up to two decimal places, hope you can point me in the right direction
LucaMs Expert Licensed User Longtime User May 12, 2020 #2 Never use Views to make calculations, use Variables. B4X: Copy Dim dblA, dblB, dblC As Double dblA = lblA.Text dblB = lblB.Text dblC = dblA * dblB lblC.Text = NumberFormat2(dblC, 1, 2, 2, True) Upvote 0
Never use Views to make calculations, use Variables. B4X: Copy Dim dblA, dblB, dblC As Double dblA = lblA.Text dblB = lblB.Text dblC = dblA * dblB lblC.Text = NumberFormat2(dblC, 1, 2, 2, True)