There are various ways to convert data types in the .NET framework, but if you are coding with
VB.NET (not C#) then you can use the same functions you have used all along with VBScript
:
CINT( )
CDBL( )
CCURR( )
CSTR( )
and so on.
The only difference is that whereas CINT() in VBScript only handled 16 bit numbers (and so was limited to the range -32768 to 32767), CINT() in
VB.NET handles full 32 bit number (+/- 2 billion). And CLNG() in
VB.NET handles 64 bit numbers. All the other Cxxxx functions remain the same.
So, if MonthlyCost is a string, you should be able to do
<%=2 * CCurr(MonthlyCost)%>
or
<%=2 * CDbl(MonthlyCost)%>