Avatar of NevSoFly
NevSoFly
 asked on

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

Avatar of undefined
Last Comment
NevSoFly

8/22/2022 - Mon
Fernando Soto

Can you show us some code?
Jacques Bourgeois (James Burger)

CInt (0.222222222222 * 10000) / 10000
ASKER CERTIFIED SOLUTION
13Shadow

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)

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

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