About
Pricing
Community
Teams
Start Free Trial
Log in
NevSoFly
asked on
1/9/2014
Is there a way to stop vb.net from rounding?
I have a variable in a calculation with a decimal value of 0.222222222222 the format limits this to 4 decimal places so the result should be 0.2222 but the result ends up being 0. Is there a way to make it display correctly (stop rounding)?
Visual Basic.NET
5
2
Last Comment
NevSoFly
8/22/2022 - Mon
Fernando Soto
1/9/2014
Can you show us some code?
Jacques Bourgeois (James Burger)
1/9/2014
CInt (0.222222222222 * 10000) / 10000
ASKER CERTIFIED SOLUTION
13Shadow
1/9/2014
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Jacques Bourgeois (James Burger)
1/9/2014
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
NevSoFly
1/9/2014
ASKER
As It turns out one of the values was being converted into an integer as 13Shadow suggested I am going to use James' code snippet for now.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck