locked
How can I get client machine's currency format information? RRS feed

  • Question

  • User-407800643 posted
    I can get client machine's language setting by Request.UserLanguages

    But how can I get number and currency format information of client machine? that is , the information set by: control panel-->reginal and language options-->standards and formats. For example, I can set this format to Spanish(Argentina).
    Monday, August 22, 2005 10:32 PM

All replies

  • User623265419 posted
    Hi,
     following might help u.

    CultureInfo cl=new CultureInfo
    (Thread.CurrentThread.CurrentCulture.Name) //gives culture on machine

    cl.NumberFormat.CurrencyDecimalDigits
    cl.NumberFormat.CurrenySymbol etc..
    Regards.

    Tuesday, August 23, 2005 8:13 AM
  • User-407800643 posted
    what Thread.CurrentThread.CurrentCulture gets is the information of server , not client machine.

    for our application is cient-server architecture. Client access server by web page.
    All logics run in IIS server.

    So we can't get client machine's information by Thread.CurrentThread.CurrentCulture
    Wednesday, August 24, 2005 3:13 AM
  • User1058324349 posted
    ' This may help:
    ' 1st we get the current client (preferred) language;
    Dim Lang as String
    Lang = Request.UserLanguages(0)
    ' Then we create the CultureInfo from it
    Dim CurrentCulture As New CultureInfo(Lang)
    ' Now we use it's properties...
    Respnse.Write(CurrentCulture.NumberFormat.CurrencySymbol & "<br>")
    Respnse.Write(CurrentCulture.NumberFormat.PercentSymbol) ' ...
    ' Omid!
    Saturday, August 27, 2005 6:10 PM
  • User-1367298821 posted
    May I ask why? The reasons I ask is that a common mistake is to try and format up results by hand rather than correctly setting the formatters culture.
    Saturday, September 10, 2005 1:17 PM