E' possibile poter calcolare la media dei valori numerici di una ListView?

Salve a tutti,
tramite una ListView ho creato una semplice lista della spesa. Inserendo invece dei soli caratteri numerici nella ListView; sarebbe possibile poter effettuare la media?
Saluti
Nicola

Don't understand, what do you mean by this ?

1 Like

@TIMAI2 vorrei inserire in una ListView tutti i km effettivi fatti con ogni pieno di benzina; e poter visualizzare magari in una label, la media complessiva.

Pieno 1 - 317 km
Pieno 2 - 192.30 km
Pieno 3 - 198.30 km
Media: 235.87

If only numbers are in the list (see first post)
blocks(3)

Scrivere in inglese no ? difficile tradurre media..

1 Like

I would like to insert in a ListView all the actual km made with each tank of petrol; and being able to view the overall average in a label.

Full 1 - 317 km
Full 2 - 192.30 km
Full 3 - 198.30 km
Average: 235.87


average( shred(list_to_csv(ListView.Elements, '-', ' km'))

@ABG I didn't quite understand how to link your procedures to the ListView.

You have to apply the procedures to the list on which the ListView.is based

@ABG how is the "Call sum" procedure composed?

This method works, but it is not programmatically elegant, since it uses the Label.Text as a variable.

1 Like

I apologize for leaving it out in my prior post.

Here is is, with its use in another sample app ...



Capture
Sum.aia (2.7 KB)

1 Like

@Juan_Antonio non fa niente se non è elegante a livello di codice; la cosa importante è il risultato finale. Grazie mille e buona serata
Saluti
Nicola

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.