When adding a Double, Single or Currency value with JSONWriter.AppendValue and the server (or client if in Notes) has a custom decimal symbol in regional setting in Windows, the wrong decimal symbol is used.
Steps to reproduce in Domino:
- Open Regional Settings on the server
- Choose Customize in the Regional Options tab.
- Set comma (,) as Decimal symbol.
- Click OK.
- The server might have to restart.
- Create code:
Dim jsonWriter As New JSONWriter()
json = json + jsonWriter.BeginObject()
json = json + jsonWriter.Key("decimalvalue")
Dim value As Currency
' or Dim value As Single
' or Dim value As Currency
value = 123.45
json = json + jsonWriter.AppendValue(value)
- json contains {"decimalvalue":123,45"} but should contain {"decimalvalue":123.45"}
Crude patch
' Added to members:
Private m_decimalSeparator As String ' The decimal separator used on the system
' Added to sub New:
m_decimalSeparator = Left(Cstr(Fraction(0.1)), 1)
' Changed in AppendValue:
Case V_INTEGER, V_LONG, V_DOUBLE, V_CURRENCY, V_BYTE:
sReturn = Join(Split(Cstr(p_vValue), m_decimalSeparator), ".")
I guess there are more efficient ways of doing this though.