M
Martyn Fewtrell
Hi there
I'm sure there is a straight forward answer to this but I haven't quite got
there.
If I have a String in Sterling Currency Format and try to convert this to a
Decimal (for arithmetic purposes it works fine).
Sample code (VB.Net):
Dim UK As New CultureInfo("en-GB")
SA.Text = (S1.Text * S2.Text).ToString("c", UK)
Dim decSterling as Decimal = SA.Text
(where S1, S2 and SA are text boxes)
If I run the identical code for Dollars this fails with the exception can't
convert String "$...." to Decimal
Sample Code (VB.Net):
Dim US As New CultureInfo("en-US")
DA.Text = (D1.Text * D2.Text).ToString("c", US)
Dim decDollars as Decimal = DA.Text
(where D1, D2 and DA are text boxes)
Why can I convert a string to decimal when using £ (Sterling) but not $
(Dollars)
Thanks for your help
Martyn Fewtrell
(e-mail address removed)
I'm sure there is a straight forward answer to this but I haven't quite got
there.
If I have a String in Sterling Currency Format and try to convert this to a
Decimal (for arithmetic purposes it works fine).
Sample code (VB.Net):
Dim UK As New CultureInfo("en-GB")
SA.Text = (S1.Text * S2.Text).ToString("c", UK)
Dim decSterling as Decimal = SA.Text
(where S1, S2 and SA are text boxes)
If I run the identical code for Dollars this fails with the exception can't
convert String "$...." to Decimal
Sample Code (VB.Net):
Dim US As New CultureInfo("en-US")
DA.Text = (D1.Text * D2.Text).ToString("c", US)
Dim decDollars as Decimal = DA.Text
(where D1, D2 and DA are text boxes)
Why can I convert a string to decimal when using £ (Sterling) but not $
(Dollars)
Thanks for your help
Martyn Fewtrell
(e-mail address removed)