Lease numbers financially

0

I'm building a basic payroll system in VB.NET, and for example, when I split 2500 to 220 the result will be 11,363636363636363636363636363636 .

How can I do a rounding, for example, to get results with% of two houses after the comma

    
asked by anonymous 15.11.2017 / 23:21

1 answer

1

You can use Round() . I hope you're using decimal on the payroll.

There are cases that need to deal with the excess of rounding by virtue of legislation.

Imports System.Console
Imports System.Math

Public Class Program
    Public Shared Sub Main()
        WriteLine(Round(2500D / 220, 2))
    End Sub
End Class

See running on .NET Fiddle . And no Coding Ground . Also I placed GitHub for future reference .

    
15.11.2017 / 23:38