Hi there,
Since you are asking for an abnormal thing (forth digit always rounded up),
then you should do some text manipulations to get the required result.
Here is a function which will return the value you need:
you should supply this function with the two input fields while calling it.
=========================
=========================
Private Function GetRequiredNumber(ProdNorm as Long, WB as Long) as Long
Dim OriginalDivisionResult as String
Dim IntegerPart as String
Dim Final as String
'getting the integer part only and converting it to STRING
IntegerPart=Trim(Str(Int(WB/ProdNorm)))
'converting the entire result to a string with no preceding spaces.
OriginalDivisionResult=Trim(Str(WB/ProdNorm))
Final= IntegerPart & Mid(OriginalDivisionResult, Len(IntegerPart)+1,4) &
(Val(Mid(OriginalDivisionResult, Len(IntegerPart)+5,1)+1)
GetRequiredNumber=Val(Final)
End Function
============================
============================
What this function will do is, it will convert the devision resulting number
into a STRING, then it will take the INTEGER, the DOT, and the first 3
dicimal digits as they are, then it will add ONE to the forth digit. Which
is exactly what you want.
Try it, and let me know if you have any problems.
Regards
Rashed
MikeG said:
On a form I have two fields:
[ProductionNorm]
[WageBase]
I would like to have a text box calculate a piece rate
([WageBase]/[ProductionNorm]) that rounds up the results to 4 decimal places.
example: [WageBase]/[ProductionNorm] 7.5/260 = .028846153 I would want
the results to say .0289
Can this be done?