Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mix up in CultureInfo
Message
From
10/09/2015 14:22:48
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01624382
Message ID:
01624479
Views:
23
>My suggestion was only good for "N" format - you didn't mention Currency. Not sure where your 'nLanguage' is set - presumably at the session level ?
>If I was looking for the same functionality I'd probably do :
Public Structure Cultures
>	Public Const English As String = "en-US"
>	Public Const French As String = "fr-CA"
>	Public Const Spanish As String = "en-US"
>	Public Const Portuguese As String = "en-US"
>End Structure
set nLanguage to Cultures.French (or whatever) then
Public Shared Function GetFormatValue(tnValue As Double, tcSeperator As String, tnDecimal As Integer) As String
>	Dim nfi As NumberFormatInfo = New CultureInfo(nLanguage).NumberFormat
>	nfi.NumberDecimalSeparator = "."
>	nfi.NumberGroupSeparator = tcSeperator
>	nfi.NumberDecimalDigits = tnDecimal
>
>	Select Case nLanguage
>		Case Cultures.French
>			If True Then
>				nfi.CurrencyPositivePattern = 1
>				Exit Select
>			End If
>	End Select
>
>	Return tnValue.ToString("C", nfi)
>End Function
Thanks
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
Previous
Reply
Map
View

Click here to load this message in the networking platform