On Mon, May 19, 2008 at 11:04 AM, SG <[EMAIL PROTECTED]> wrote: > jack ha scritto: > >> Function myRoundUp (Numero As Double, Cifre As Integer) As Double >> print "Step 1: " + (Numero+0.5/10^Cifre) >> print "Step 2: " + ((Numero+0.5/10^Cifre)*10^Cifre) >> print "Step 3: " + Int((Numero+0.5/10^Cifre)*10^Cifre) >> myRoundUp=Int((Numero+0.5/10^Cifre)*10^Cifre)/10^Cifre >> End Function >> >> > Ciao Jack, > il .... "problema" รจ la funzione "int" che ti restituisce la sola parte > intera di numero quindi: > > int(554.8) = 554 > int(554.5) = 554 > int(554.2) = 554 > > dovresti inserire un IF: > > if (xNumero - int(xNumero)> .4 then xRisultato = int(xNumero)+1 else > xRisultato = int(xNumero) > > oppure: > > xRisultato = Format(xNumero, "#.###")
Mi sorge un dubbio: al passo 2 della mia macro ti restituisce 555?
