Raising numbers financially

Asked

Viewed 69 times

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);

  • right, but where should I put it? in the textbox in which displays the result?

  • So it’s your decision where you show off !?

  • 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.

  • Matheus puts the code you’re asking in the question

  • Dim num7 As Double Dim num8 As Double num7 = Val(Textbox7.Text) num8 = Val(Textbox8.Text) Textbox10.Text = num7 / num8 would be this one

  • I believe that’s TextBox10.Text = Math.Round(num7/num8,2).ToString(); based on the commentary.

  • 1

    That right there, it worked. Thank you very much!

  • @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).

Show 4 more comments

1 answer

3

  • Yes I understand, but you could teach me how to use the Round() function or give me a tutorial on the internet that teaches it, I never used it.

  • @Mateusjustino System.Math.Round(dec numeroDeEntrada, int decimais) https://msdn.microsoft.com/pt-br/library/system.math.round(v=vs.110). aspx

Browser other questions tagged

You are not signed in. Login or sign up in order to post.