我需要让它看起来像¥65,826.00自动。并接受其他货币
Private Sub acquisitioncost_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles acquisitioncost.LostFocus
Dim dec As Decimal
If Decimal.TryParse(acquisitioncost.Text, System.Globalization.NumberStyles.Currency, Nothing, dec) Then
acquisitioncost.Text = dec.ToString("C")
End
End Sub
答案 0 :(得分:0)
Dim dec As Decimal
If Decimal.TryParse(acquisitioncost.Text, System.Globalization.NumberStyles.Currency, Nothing, dec) Then
'acquisitioncost.Text = String.Format("{0:C}".Remove(0, 1), dec)
If curcmb.Text = "JPY" Then
acquisitioncost.Text = dec.ToString("C", CultureInfo.CreateSpecificCulture("ja-JP"))
ElseIf curcmb.Text = "GBP" Then
acquisitioncost.Text = dec.ToString("C", CultureInfo.CreateSpecificCulture("en-GB"))
ElseIf curcmb.Text = "PHP" Then
acquisitioncost.Text = dec.ToString("C", CultureInfo.CreateSpecificCulture("fil-PH"))
ElseIf curcmb.Text = "USD" Then
acquisitioncost.Text = dec.ToString("C", CultureInfo.CreateSpecificCulture("en-US"))
ElseIf curcmb.Text = "EUR" Then
acquisitioncost.Text = dec.ToString("C", CultureInfo.CreateSpecificCulture("de-DE"))
Else
acquisitioncost.Text = dec.ToString("C").Remove(0, 1)
End If
'acquisitioncost.Text = dec.String.Format("{0:C}", price)
End If