0
I am mounting a basic payroll system in VB.NET, and for example when I do splitting 2500
for 220
the result will be 11,363636363636363636363636363636
.
There is how I make a rounding for example to result stay 11,36
two boxes after the comma
decimal value = Math.Round(2500M / 220, 2);
– novic
right, but where should I put it? in the textbox in which displays the result?
– Mateus Justino
So it’s your decision where you show off !?
– novic
So I put it in the textbox, but it gets wrong, I put exactly the same code that Oce gave me, but it shows the message " 'Decimal' is a type and cannot be used as an Xpression." saying that 'decimal' is a type and cannot be used as an expression. Excuse is that I still do not understand much.
– Mateus Justino
Matheus puts the code you’re asking in the question
– novic
Dim num7 As Double Dim num8 As Double num7 = Val(Textbox7.Text) num8 = Val(Textbox8.Text) Textbox10.Text = num7 / num8 would be this one
– Mateus Justino
I believe that’s
TextBox10.Text = Math.Round(num7/num8,2).ToString();
based on the commentary.– novic
That right there, it worked. Thank you very much!
– Mateus Justino
@Mateusjustino Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how to do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero