• Revista PROGRAMAR: Já está disponível a edição #53 da revista programar. Faz já o download aqui!

Sign in to follow this  
Followers 0

[VB6] Arredondar números

1 post in this topic

Public Function ArredondarNumero(NumeroInserido As Variant,_CasasDecimais As Integer) As Variant

Dim Temp As Double, Decimais As Long
Temp = CDbl(NumeroInserido)
Decimais = 10 ^ CasasDecimais
ArredondarNumero = (Fix((Temp + 0.5 / Decimais) * _
Decimais)) / Decimais
End Function


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0