Author Topic: keypad failure if decimal separator of regional settings is comma  (Read 2463 times)

Tril

  • Newbie
  • *
  • Posts: 9
    • View Profile
I'm using version 3.52. I'm from Canada, we use the comma "," as the decimal separator. When using the keypad on a BasicLabel to enter floating point numbers, it fails in the KeypadPopUp_ButtonClick function if the decimal separator of the regional settings is comma because the keypad inserts a dot in the string.

Below is my quick fix. You could find a better solution and include it in the next version. After "If KeypadPopUp.Value <> "" Then", add  :
Code: [Select]
Dim DecimalSeparator As Char = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator()
If StrComp(DecimalSeparator, ",") = 0 Then
  KeypadPopUp.Value = Replace(KeypadPopUp.Value, ".", ",")
End If

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: keypad failure if decimal separator of regional settings is comma
« Reply #1 on: August 14, 2013, 08:46:27 PM »
The keypad was updated to accommodate this globalization feature. It will be fixed in version 3.53