Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Changing currency from $ to Euro symbol and how to format - VB.NET winforms

$
0
0

I have an application in which I would like to change the format of the currency when changing my environment to a new culture, ie: Euro. I have found many links and incorporated the code change in the ApplicationEvents.vb - StartUp event: Thread.CurrentThread.CurrentCulture = New CultureInfo("de-DE",False).

This changes everything in regards to amounts, even at the DGV level, which is what I want, but the formatting is incorrect. For example, the amounts displays as such: 1.420,25 € but I would like it to display as €1420.25, €15,000.00, etc.

Using the code below will do what I want but I would have to format all text boxes and columns in the DGV

lbl_budget1.Text = ChrW(8364) + ldec_rem_transport_budg.ToString("##,#00.00")

I have also tried this with no success, it formats to 1.420,25 €

'Dim LocalFormat As NumberFormatInfo = CType(NumberFormatInfo.CurrentInfo.Clone(), NumberFormatInfo)

LocalFormat.CurrencySymbol = "G"

ls_test = ll.ToString("c", NumberFormatInfo.CurrentInfo)

Is there a way to do global formatting?

Thanks,

William


William


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>