ziorrinfotech
asked on
formating string to currency and datetime
I am reading values from a datatable.
and I want to format the Date to 6/5/2010
and decimal number to $ 100,000.00
how can i do this
This is my code
If _propertyDetailDataSet.Tab les("Prope rty").Rows (0)("DeedR ecordingDa te") IsNot DBNull.Value And
CType(_propertyDetailDataS et.Tables( "Property" ).Rows(0)( "DeedRecor dingDate") , String) <> "1/1/1900" Then
deedRecordingDateValueLabe l.Text = CType(_propertyDetailDataS et.Tables( "Property" ).Rows(0)( "DeedRecor dingDate") , String)
End If
buyInPriceValueLabel.Text = "$" & CType(_propertyDetailDataS et.Tables( "PropertyP roposed"). Rows(0)("B uyInPrice" ), String)
and I want to format the Date to 6/5/2010
and decimal number to $ 100,000.00
how can i do this
This is my code
If _propertyDetailDataSet.Tab
CType(_propertyDetailDataS
deedRecordingDateValueLabe
End If
buyInPriceValueLabel.Text = "$" & CType(_propertyDetailDataS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For Date:
Dim Inputdate As DateTime = Convert.ToDateTime("6-5-20
Dim FormattedDate As String = Inputdate.ToString("MM/dd/
For Amount:
Dim InputAmt As String = "$ 10000000000"
Dim Amount As Double = Double.Parse(InputAmt.Repl
Dim deciPart As String = String.Format("{0:#\.##}",
Dim IntPart As Integer = String.Format("{0:#\.##}",
Dim revenue As String = IntPart.ToString("###,##")
revenue = "$" + revenue + "." + deciPart.Split(".")(1).ToS