Quantcast
Channel: Arredondar
Viewing all articles
Browse latest Browse all 3

Arredondar

$
0
0
Option Explicit

Sub TESTE()



Dim NUMERO As String
Dim NUMERO2 As Integer
Dim PNUMERO As Integer
Dim V As Integer

NUMERO = CStr(102.33)
V = InStr(1, NUMERO, ",")
If V = 3 Then
If Right(NUMERO, 2) = "33" Or Right(NUMERO, 2) = "44" Then
 PNUMERO = Left(NUMERO, 1) * 10

NUMERO2 = CInt(PNUMERO + 4)
MsgBox NUMERO2
End If
End If

If V = 4 Then
If Right(NUMERO, 2) = "33" Or Right(NUMERO, 2) = "44" Then
 PNUMERO = Left(NUMERO, 1) * 100

NUMERO2 = CInt(PNUMERO + 4)
MsgBox NUMERO2
End If
End If



If V = 2 Then
If Right(NUMERO, 2) = "33" Or Right(NUMERO, 2) = "44" Then
 PNUMERO = 0
NUMERO2 = CInt(PNUMERO + 4)
MsgBox NUMERO2
End If
End If





End Sub


Anderson Diniz diniabr2011@gmail.com


Viewing all articles
Browse latest Browse all 3


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>