Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > Get the decimal separation sign on the users system
 

Get the decimal separation sign on the users system

How to get the sign that is used to indicate decimal digits? For example: in England a number would look like 4,000,000.04 In The Netherlands however the same number would be 4.000.000,04 How can I find out if the users system uses the . or the , to specify decimals?
famlam  13 hours 29 minutes ago
You want to get the current culture's NumberFormat property... For example:

Option Strict On
Option Explicit On

Imports System.Threading
Imports System.Globalization

Module Module1


    Sub Main()
        Dim nfi As NumberFormatInfo = Thread.CurrentThread.CurrentCulture.NumberFormat
        Console.WriteLine(nfi.NumberDecimalSeparator)

    End Sub

End Module



HTH

Tom Shelton
  • Marked As Answer byfamlam 10 hours 46 minutes ago
  •  
Tom Shelton  13 hours 7 minutes ago
System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyGroupSeparator
If it is not the culture currently being used, there are shared methods in CultureInfo that allow you to load them based on its name.
syntaxeater  13 hours 11 minutes ago
You want to get the current culture's NumberFormat property... For example:

Option Strict On
Option Explicit On

Imports System.Threading
Imports System.Globalization

Module Module1


    Sub Main()
        Dim nfi As NumberFormatInfo = Thread.CurrentThread.CurrentCulture.NumberFormat
        Console.WriteLine(nfi.NumberDecimalSeparator)

    End Sub

End Module



HTH

Tom Shelton
  • Marked As Answer byfamlam 10 hours 46 minutes ago
  •  
Tom Shelton  13 hours 7 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• VB Datarows export to another Form
• how to add an image in ms word trough code
• Is the process running in foreground or background
• OCR method of MODI
• Check my code to hide taskbar clock and close program safely pls...
• Problems with word object
• MS Excel cell and Worksheet properties / attributes for use with VB
• FIFO stream
• Accessing the registry of a remote computer
• is there an easy way to valid an input to only be numbers 1 to 9 or . ?