Mythran,
There is probably a more elegant way, but this might work for you:
Dim value As Decimal = 1234.56
Dim s As String = value.ToString("Negative $#,##0.00;Negative
$#,##0.00;")
Dim s2 As String
Dim d As Decimal
s2 = s.Replace("Positive ", "")
s2 = s2.Replace("Negative ", "-")
d = Decimal.Parse(s2, System.Globalization.NumberStyles.Currency)
MsgBox(s)
MsgBox(d)
Kerry Moorman
"Mythran" wrote:
> Dim value As Decimal = 1234.56
> Dim format As String = _
> "Positive $#,##0.00;Negative $#,##0.00;"
>
> Dim s As String = value.ToString(format)
> Dim d As Decimal = Decimal.Parse(s)
>
> The last line above throws an exception because it can't parse "Positive
> $1,234.56". It can convert to that format, but how can one go about parsing
> it using the same format that was used to format it as a string? Is there
> an easy way w/o too much work?
>
> Thanks,
> Mythran
>
>
>
|