4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by sknake
0

Use string classes Format method:

Dim Money As Double = 1234.56
MsgBox(String.Format("{0:C}", Money))

HTH

0

Tq bro,

but still got problem...i cannot change or update that value in this textbox...anyone can guide me please...tq in advance

0

Convert currency back to decimal value

Dim Money As Double = 1234.56
Dim MoneyStr As String
MoneyStr = String.Format("{0:C}", Money)

' DEBUG
MsgBox(MoneyStr)

Dim MoneyToUpdate As Double
MoneyToUpdate = [Double].Parse(MoneyStr, Globalization.NumberStyles.Currency)

' DEBUG
MsgBox(MoneyToUpdate)

You should put [Double].Parse in a Try...Catch...End Try block or use [Double].TryParse method instead.

HTH

0

Tq bro,

but still got problem...i cannot change or update that value in this textbox...anyone can guide me please...tq in advance

Is the textbox set ReadOnly = true or Enabled = false ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.