tags:

views:

20

answers:

2

I am using this line :

FormatCurrency(DBReader("Price").ToString, 2, True)

to format my Currency and I have two websites, the first one is English and the second is Arabic.

In the English website the price will be in $ Currency because the the localization setting is set as "en-US".

In the Arabic website the price will be in ل.ل Currency because the the localization setting is set as "ar-LB".

The question is how to format this code:

FormatCurrency(DBReader("Price").ToString, 2, True)

to make the currency in the $ only in both websites?

A: 

In your FormatCurrency method make use of NeutralCulture or en-US culture

ajay_whiz
I cange it to :FormatCurrency(DBReader("Price").ToString("C", _ Globalization.CultureInfo.CreateSpecificCulture("da-DK")), 2, True)and I had this Error:Too many arguments to 'Public ReadOnly Default Property Chars(index As Integer) As Char!!can you please show me how to modify the code to make it work Please
HAJJAJ
what are you trying to do in your `FormatCurrency` method?
ajay_whiz
String.Format("{0:F2}", DBReader("Price"))
HAJJAJ
A: 

Check out the examples here, that use the overloaded toString function coupled with a format specifier and locale.

Will A
String.Format("{0:F2}", DBReader("Price"))
HAJJAJ