FORMULARIO CON PORCENTAJES

 FRMULARIO CON PORCENTAJES

Si te refieres a calcular tantos por ciento, lo mismo te sirve la siguiente función:

    Public Function Porcentaje(ByVal cantidad As Decimal, ByVal tipoPorcentaje As Decimal) As Decimal

        Return (cantidad * tipoPorcentaje) / 100

    End Function

Por ejemplo, quieres calcular el 20 por 100 de 18343,234:

    Dim resultado As Decimal = Porcentaje(18343.234D, 20)

Resultado:   3668,6468



Comentarios