Skip to content

Convert from Single to Decimal

George George

Asked Jun 11, 2008, 4:15 AM EDT2 answers
Share
LinkedInX

Hello everyone,


I think convert from Single or Double to Decimal is always fine since Decimal has broader precision and broader range. Why it is mentioned,

"Conversions from Single or Double to Decimal throw an OverflowException if the result of the conversion is not representable as a Decimal."

http://msdn.microsoft.com/en-us/library/system.decimal(VS.80).aspx


thanks in advance,
George

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0

    If you convert this single value to decimal, you will get an overflow exception:

    1.2345678E+30F 

    0
  • 0

    Great!

     

    Question answered.

     

    regards,

    George

    0