ToDecimal

  • Thread starter Thread starter John
  • Start date Start date
J

John

I am just starting to use asp.net and I do not have the
ToDecimal function. Do I have to install a library to
get it?
 
Convert.ToDouble Method Converts a specified value to a
double-precision floating point number.

This is .Net frame work class library. No need of separate
Intallation. At Framework SDK documentation you will get
the details regarding other Convert methods.
 
John said:
I am just starting to use asp.net and I do not have the
ToDecimal function. Do I have to install a library to
get it?

John,
You can convert to a double by either using the Double's Parse method
or VB.NET's CType (or C# Convert).

Dim s1 As String = "1.1"
Dim d1 As Double = Double.Parse(s1)
Dim d2 As Double = CType(s1, Double)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com
 
Carl Prothman said:
John,
You can convert to a double by either using the Double's Parse method
or VB.NET's CType (or C# Convert).

Dim s1 As String = "1.1"
Dim d1 As Double = Double.Parse(s1)
Dim d2 As Double = CType(s1, Double)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com

I think Carl forgot that you were talking about Decimal. Everything
he said about Double will also work for Decimal. (
CarlsMessage.Replace("Double", "Decimal") should take care of it
<grin>)

Scott
 
Back
Top