Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird behavior on localization
Message
De
30/07/2010 11:25:20
 
 
À
30/07/2010 07:14:22
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01474524
Message ID:
01474607
Vues:
42
>I guess that boils down to this line:
lcValue = Format(tnValue, lcFormat) + "$"
which is using the legacy Microsoft.VisualBasic.Strings stuff. I don't really remember how that worked but I think it translates based on the Windows locale rather then the .NET current culture. Why not just use the .NET .ToString() methods e.g.:
Public Function GetFormatValueDollar(ByVal tnValue As Double, ByVal nLanguage As Integer) As String
>        Dim info As CultureInfo
>        Select Case nLanguage
>            Case 1
>                info = New CultureInfo("en-US")
>            Case Else
>                info = New CultureInfo("fr-CA")
>                ' If you want different separators:
>                info.NumberFormat.CurrencyDecimalSeparator = "."
>                info.NumberFormat.CurrencyGroupSeparator = ","
>
>        End Select
>        Return tnValue.ToString("c", info)
>    End Function
Thank you, I will use that.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform