i have a function that showing the output from a calculation.
i want to make it looks good on the spacing but i can't do it
help me how to use the space()
Or is there anything to make it in other way
i would like to make the output like thisCode:Private Sub Tampil_Data() Dim rp As String = "Rp " kata &= "Project " & k + 1 & vbCrLf kata &= "======================================================" & vbCrLf kata &= "year Perkiraan arus kas proyek " & k + 1 & " Arus Kas Kumulatif" & vbCrLf kata &= "======================================================" & vbCrLf kata &= Space(1) & "0 (inves)" & Space(5) & rp & Format(inves(k), "#0.00") & Space(48 - ((Format(inves(k), "#0.00")).Length + "0 (inves)".Length)) & rp & Format(inves(k), "#0.00") & vbCrLf For j = 0 To thn - 1 dataKas(k, j) = inves(k) + data(k, j) kata &= Space(1) & j + 1 & Space(16 - (Format(j + 1, "0").Length) - 1) & rp & Format(data(k, j), "#0.00") & Space(42 - (Format(data(k, j), "#0.00").ToString.Length + rp.Length + (Format(j + 1, "0").Length) + dataKas(k, j).ToString.Length)) & rp & Format(dataKas(k, j), "#0.00") & vbCrLf inves(k) = inves(k) + data(k, j) Next kata &= "======================================================" & vbCrLf End Sub
the problem just how to make the output like thatCode:year Perkiraan arus kas proyek 1 Arus Kas Kumulatif 0 (inves) Rp -1000.00 Rp -1000.00 1 Rp 500.00 Rp -500.00 2 Rp 400.00 Rp -100.00 3 Rp 10.00 Rp -90.00 4 Rp 5.00 Rp -85.00 5 Rp 1100.00 Rp 1015.00
help me plz
thx




Reply With Quote