Return to Snippet

Revision: 13624
at April 29, 2009 14:15 by delm


Initial Code
Public Shared Function DecimalAleatorio(Optional ByVal maximo As Decimal = Decimal.MaxValue, Optional ByVal minimo As Decimal = Decimal.MinValue) As Decimal
        Dim r As New Random()
        If minimo > maximo Then
            Dim t As Decimal = minimo
            minimo = maximo
            maximo = t
        End If
        lastdecimalvalue = (r.NextDouble() * (maximo - minimo)) + minimo
        Return lastdecimalvalue

Initial URL

                                

Initial Description
Retorna un decimal aleatorio entre un mínimo y un máximo.

Initial Title
Decimal aleatorio

Initial Tags

                                

Initial Language
VB.NET