Closed rasm685p closed 5 years ago
try double num4 = num3.ToDouble();
or int num4 = (int)Math.Round(num3.ToDouble());
num4
should equal 10
, representing 10% of a progress bar.
(Note that if you use VERY large numbers you may want to calculate progress bars in terms of the log10 of both numbers, like how Antimatter Dimensions does it.)
@Patashu Thank you! I can finally continue my "game" 👍
I'll close this. Thanks for making the BreakInfinity library
Yay! Sorted before I even wake up; cheers.
Side notes:
.ToDouble
and (int)
casting are preferable. It actually applies to most of other C# code - you can do 99% of type conversions without Convert
class (iirc, it was introduced to handle some edge cases)hp1.Value
won't be very big, based on hp1.Maximum = 100;
. Are you sure you really want to use BigDouble
in this case?@Razenpok You might want to look at my github repository "Monster Hunt" if you got the time? But yeah I figured out that bigdouble isn't the best solution for everything 😃
Looks okay so far, though I'd suggest two things:
BigDouble
unless you are working with really big numbers - you'll know when you will need it. But until then, use stock double
or float
.
I'm trying to use a bigdouble number in a progress bar but it might not be possible? I wanted to do something like this:
Is this even possible? I tried converting it to a string and then back, but the number gets too large.