I need to obtain the fractional part of a double. AFAIK C# and .NET has no such function.
Have a few options here:(x is a double)
x - (int)x
x - Math.Truncate(x)
Convert to a string and extract the fraction...
Perhaps someone knows other options?
Which should I choose or does it not matter that much?
Thanks in advance for some answers. :)
All 6 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.