-->>SOmething is Confusing Me or Doesn't provide Me with actual Results I needed...
-->>I want to Calculate some Numbers and Its result if It has more than 3 decimal places...
-->>I want it to be rounded only to 2 decimal palces...
-->>What I dont want is that when I use Vb6 Inbuilt Functions for this it does some aproxmations...
-->>For Example if the Number is 0.3195 it gives me 0.32,this is bad for Me...
-->>I only need the 2 decimal places without approximating the Third digit...
-->>That is the Number 0.3195 to be 0.31!!!
-->>So how can I do It? Please help...
-->>Thanks...
Bile
10
Newbie Poster
Recommended Answers
Jump to PostTry this,
Dim test2 As Double = 0.3195 Dim test As Double = Fix(test2 * 10 ^ 2) / 10 ^ 2
this will produce
.31
as the value of test. If you want more decimal places change the2
in10 …
All 4 Replies
tinstaafl
1,176
Posting Maven
AndreRet
526
Senior Poster
Bile
10
Newbie Poster
AndreRet
526
Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.