首页 > 解决方案 > Change Currency in aspx vb code

问题描述

I have been given a website in aspx and I had to make some changes. Unfortunately I am not a programmer, but I have managed to do most of the changes by looking at the code and using common sense. But they only thing I am not able to do is change the currency from $( us dollars) to £(GBP) basically I have a form with a dropdown list( see image) drop down menu with $ and the code is this

InsertFirstListItem(DropDownCoverAmount, "How much cover would you like?", "")
DropDownCoverAmount.Items.Add(New ListItem("Less than £50,000", "upto50"))
For intLoop As Integer = 50000 To 700000 Step 10000
DropDownCoverAmount.Items.Add(New ListItem(intLoop.ToString("C0"), intLoop.ToString))
Next
DropDownCoverAmount.Items.Add(New ListItem("More than £700,000", "above700"))

It's going up by 10.000 from 50.000 to 700.000 But it does it in dollars. How and where would I change it to GPB £

Any Help will be highly appreciated

Update (2018-06-18 12:39:19Z):

Following the comments, the code is now

InsertFirstListItem(DropDownCoverAmount, "How much cover would you like?", "")
DropDownCoverAmount.Items.Add(New ListItem("Less than £50,000", "upto50"))
Dim ci = New Globalization.CultureInfo("en-GB")
For intLoop As Integer = 50000 To 700000 Step 10000
    DropDownCoverAmount.Items.Add(New ListItem(intLoop.ToString("C0", ci), intLoop.ToString))

but still getting errors.

标签: asp.netvb.netlocalization

解决方案


推荐阅读