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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Strings in AssetCenter 3.6

Status
Not open for further replies.

Shazza

Technical User
Aug 21, 2000
38
NZ
I have the following calculation which returns 567.9099393
Set [FV_ClientBuy] = cDbl([Product.mPrice]/(1-0.7))

I would like to know if there is a function that will allow me to round this number to 2 decimal places.

I am trying to populate a string field, and it needs to be a string for other reasons.

Thanks in advance

 
Shazza

Try This

<-------------------- Cut Here
Function amRoundUp(ByVal dNum as Double) as Double
Dim lErr as Long
Dim holeNo as String, Digit as String, Remain as String, twoDigit as String
Dim dNumber as Double

holeNo = LeftPart(CStr(dNum),&quot;.&quot;,0)

Remain = RightPartFromLeft(CStr(dNum),&quot;.&quot;,0)

Digit = Mid(Remain,3,1)

twoDigit = Mid(Remain,1,2)

If Digit > 4 Then
dNumber = CDbl(holeNo &&quot;.&quot;& twoDigit) + 0.01
Else
dNumber = CDbl(holeNo &&quot;.&quot;& twoDigit)
End If

amRoundUp = dNumber

End Function

<------- End Cut

Jason Thomas
AssetCenter Consultant
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top