Answer the question
In order to leave comments, you need to log in
Not correct conversion from float to int C#?
I can't figure out why it works differently. example below.
float val = 0.94;
(int)(val*100)
Result 93 ?
float val = 0.94;
float val1 = val*100;
(int)(val1)
Result 94 ?
Answer the question
In order to leave comments, you need to log in
Correct. Read about how floats work. Take a look at decimal. They may be suitable for your purposes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question