"Dim btt, ctt As Integer
Dim lb, ib As Double
Dim nb as Double
Dim lc, nc, ic As Double
For j As Integer = 0 to BiglBox.RowCount-1 //Ripete per tutte le righe della listbox
Dim b As String =BiglBox.CellValueAt(j, 2) //Raccoglie il valore delle varie celle
Dim bb As String =CenBox.CellValueAt(j, 2) //
Dim c As String =BiglBox.CellValueAt(j, 3) //
Dim cc As String =CenBox.CellValueAt(j, 3) //
Dim d As String =BiglBox.CellValueAt(j, 4) //
Dim dd As String =CenBox.CellValueAt(j, 4) //
Dim e As String =BiglBox.CellValueAt(j, 5) //
Dim ee As String =CenBox.CellValueAt(j, 5) //
btt=btt+val(b) //Calcola i totali per i biglietti
lb = lb+val©
nb = nb+val(d)
ib = ib+val(e)
ctt=ctt+val(bb) //Calcola i totali per le cene
lc = lc+val(cc)
nc = nc+val(dd)
ic = ic+val(ee)
Next
// •••••••••••• Mostra i risultati nelle finestre dei totali •••••••••••••••
TBigl.Text=str(btt)
TLorB.Text="€ "+str(lb)
TNetB.Text=Format(nb, “\€ ##.00”) <---------------- THIS ONE
TIVB.Text=Format(ib, “\€ ##.00”)
TCen.Text=str(ctt)
TLorC.Text="€ “+str(lc)
TNetC.Text=Format(nc, “\€ ##.00”)
TIVC.Text=Format(ic, “\€ ##.00”)”
In the for/next loop 4 total values for each table are increased to show the final totals. The last 2 show, correctly, two decimal places. The first 2 are meant to show no decimal.
The one field (TNetB.Text) always show xx.00 like its parameter (nb) even though val(d) before has the correct value. It is the only one, all the others, which follow the same type of code, show the correct decimal values.
I don’t understand this behavior.