Hi Michael,
Based on my understanding, you want to get the fractional part of a decimal.
In .Net, you should first convert any double or float number into Decimal
type. Because only Decimal type is accurate, double and float are both
approximate type.
Then, Decimal type has a Truncate static method, which will return the
interger part of a decimal, so you can divided it and get the fractional
part. Like this:
Decimal d=1.58M;
Decimal fractional=d-Decimal.Truncate(d);
Console.WriteLine(fractional.ToString());
===============================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.