Hoi,
i want to count decimals (here money), but got always erros.
it should simply add the lblPreis.Text(LabelText= i.e. 3.20) to Bestellsumme (Double= i.e. 2.20)
Here is the code i am using:
B4X:
Dim Bestellsumme as Double
lblPreis.Text= NumberFormat2(lblPreis.Text,0,2,2,False)
Bestellsumme = NumberFormat2(Bestellsumme,0,2,2,False)
Bestellsumme = Bestellsumme + lblPreis.Text
lblSumme.Text = Bestellsumme
lblSumme.Visible = True
Got it - the Format of the Double is not guilty.
As i am using the comma-seperator, but the double uses the dot-seperator, i had to add simply the following:
B4X:
lblPreis.Text = lblPreis.Text.Replace(".", "").Replace(",", ".") = THIS was missing
Private Preis As Double = lblPreis.Text
Bestellsumme = Bestellsumme + Preis
lblSumme.Text = Bestellsumme
lblSumme.Visible = True