I do some calculations by using values from labels in which those labels get values from SQL.
If I use a simple way of doing division then I get very big value,
For example :
LabelTotal.Text = LabelTotal.Text / textDivide.Text
and I do division between 300/3, 300 being the number that comes from SQL, and 3 is the number that I insert manually in my text.box and I get 5 digits results without Comma or full stop separation.
What I have tried:
I tried this version of code and it did not work,
'Dim val1 As Int32 = Convert.ToInt32(Labalsum.Text)
'Dim val2 As Int32 = Convert.ToInt32(textDivide.Text)
'Dim val3 As Int32 = val1 / val2
'LabelTotal.Text = Convert.ToString(val3)
on val1 it gives me this error :
Input string was not in a correct format.
And I tried other way which is this :
Dim res As Integer = 0
res = Convert.ToInt32(LabelTotal.Text) / Convert.ToInt32(textDivide.Text)
Labalsum.Text = res.ToString()
and it gives me the same error. I would like to have the result with a full stop when it reaches 1K. Example: "1.500,25 "
Any Help is much appreciated.