Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating a value

Status
Not open for further replies.

freefour

MIS
Joined
Aug 26, 2004
Messages
33
Location
US
Hello,

While debugging a line:

If Me.paymentamount.Value = Me.Total.Value Then

I found that paymentamount was 169.08
and total was 169.078

both fields are set to currency with a decimal place of 2.

How can I format total to round before my if statment?

Thanks,

--freefour
 
Me.Total.Value = Round(Me.Total.Value, 0)

I assume that is what you are talking about - the value for the control on the form.

Also assumed you want a whole number. The 0 is for 0 characters after the decimal, so if you want tenths, then it would be 1, and 2 for 100th's and so on...

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 

kjv

Maybe what freefour wants, then, is this?

[tt]Dim roundPmtVal, roundTotVal

roundPmtVal = Round(Me.paymentamount.Value, 2)
roundTotVal = Round(Me.Total.Value, 2)

If roundPmtVal = roundTotVal Then
...
End If[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top