Hi everyone
I am trying to insert rows into a listview where most of the items are numeric.
Private Sub but_Accept_Click(sender As System.Object, e As System.EventArgs) Handles but_Accept.Click
Dim arr(13) As String
arr(0) = cbo_Vehicle.Text
arr(1) = String.Format("{0:n2}", txt_Fuel.Text)
arr(2) = String.Format("{0:n2}", txt_Service.Text)
arr(3) = String.Format("{0:n2}", txt_Oil.Text)
arr(4) = String.Format("{0:n2}", txt_Toll.Text)
arr(5) = String.Format("{0:n2}", txt_eToll.Text)
arr(6) = String.Format("{0:n2}", txt_Tyres.Text)
arr(7) = String.Format("{0:n2}", txt_Repairs.Text)
arr(8) = String.Format("{0:n2}", txt_License.Text)
arr(9) = String.Format("{0:n2}", txt_Crane.Text)
arr(10) = String.Format("{0:n2}", txt_Tracker.Text)
arr(11) = String.Format("{0:n2}", txt_Insurance.Text)
arr(12) = String.Format("{0:n2}", txt_Depreciation.Text)
lsv_Financial.Items.Add(New ListViewItem(arr))
End Sub
The value 11, 11.1 or 11.11 could be typed into, lets say, txt_fuel (Textbox).
When I add the array to the listview I get the exact copy of what was entered in the textbox instead of 11.00 or 11.10 (the only correct result is when 11.11 was entered)
I have tried a few different .Format statements but always with the same result.
Can you please advise how I can display decimalised values in the listview.
Thanks.