Fix GetStringValue formatting float and other values incorrectly

This commit is contained in:
Jonathan Jenne 2023-07-24 11:16:07 +02:00
parent 431a22c955
commit d4995b4d93
2 changed files with 16 additions and 6 deletions

View File

@ -1,12 +1,16 @@
# CHANGELOG
## 2.5.0.0
## 2.4.7.0
### Features
- Modernisierung von verschiedenen Elementen (Validator, Startseite)
- Format Strings für Textboxen (Währung, Fließkommazahlen, Datum & Uhrzeit)
- Tabellen Filter im Hauptfenster speichern
### Bugfixes
- Anzeige-/Indexierungsfehler bei Mehrzeiligen Textboxen
- Formatierungsfehler bei Fließkomma-Indexen
- Fehlerhafte Verkettung von Werten bei abhängigen Controls

View File

@ -58,22 +58,28 @@ Public Class ClassFormat
Return oConvertedValue
End Function
''' <summary>
''' Converts values to their respective data type and then back to string
''' according to the current culture
''' </summary>
''' <param name="pValue"></param>
''' <returns></returns>
Public Shared Function GetStringValue(pValue As Object) As String
Select Case pValue.GetType
Case GetType(Single)
Return DirectCast(pValue, Single).ToString(CultureInfo.InvariantCulture)
Return DirectCast(pValue, Single).ToString(CultureInfo.CurrentCulture)
Case GetType(Double)
Return DirectCast(pValue, Double).ToString(CultureInfo.InvariantCulture)
Return DirectCast(pValue, Double).ToString(CultureInfo.CurrentCulture)
Case GetType(Decimal)
Return DirectCast(pValue, Decimal).ToString(CultureInfo.InvariantCulture)
Return DirectCast(pValue, Decimal).ToString(CultureInfo.CurrentCulture)
Case GetType(Date)
Return DirectCast(pValue, Date).ToString(CultureInfo.InvariantCulture)
Return DirectCast(pValue, Date).ToString(CultureInfo.CurrentCulture)
Case GetType(DateTime)
Return DirectCast(pValue, DateTime).ToString(CultureInfo.InvariantCulture)
Return DirectCast(pValue, DateTime).ToString(CultureInfo.CurrentCulture)
Case Else
Return pValue.ToString