|
-
May 23rd, 2005, 02:03 AM
#1
Thread Starter
New Member
Last edited by theasker; May 23rd, 2005 at 05:35 AM.
-
May 23rd, 2005, 03:42 AM
#2
Hyperactive Member
Re: rounding answer
Try This
Decimal.Round( YourMathExpression, 2)
Note that decimal.Round employs bankers rounding. (Do a google search if you don't know what this is)
-
May 23rd, 2005, 04:12 AM
#3
Re: rounding answer
If you want decimal places I wouldn't use int(egers) as these do no have places... normally 
I'd use doubles and only format the end resulting calculation otherwise you'd get calculation errors from one to another calc.
cdbl for the function.
Although I think there may be problems with the accuracy as it is floating point :/ other people can comment on that.
Code:
dblTemp = Cdbl(Text15.Text) * Cdbl(Text13.Text) + (Cdbl(Text11.Text) * 12) / (52 * Cdbl(Text13.Text))
Text20 = format(dblTemp,"#,#0.00")
Experiment with it and see which way gives you the results you want.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 23rd, 2005, 04:45 AM
#4
Thread Starter
New Member
Re: rounding answer
no luck..
-
May 23rd, 2005, 05:12 AM
#5
Re: rounding answer
Here is an idea for you:
Create a new variable as a string version of your number.
With that, split the number using Mid$() to get the actual decimal you want to check.
Then, turn that back into a number and check if it is below or above 5 and go from there 
Cheers,
RyanJ
-
May 23rd, 2005, 05:34 AM
#6
Thread Starter
New Member
Re: rounding answer
thanx man!! when i posted
no luck
that was for the guy that told me to use decimal.round... but u posted just before me lol, and thanx! it works!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|