From db852cf15d112ae7e11aa18d6f3a80b50b1318c4 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Wed, 29 Mar 2023 12:37:10 +0200 Subject: [PATCH] Use deterministic culture when converting to string --- .../Resources/Internal/RuntimeTypeConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs b/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs index c76aa09b82..b209964232 100644 --- a/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs +++ b/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs @@ -46,7 +46,7 @@ public static class RuntimeTypeConverter return value; } - string? stringValue = value.ToString(); + string? stringValue = value is IFormattable cultureAwareValue ? cultureAwareValue.ToString(null, cultureInfo) : value.ToString(); if (string.IsNullOrEmpty(stringValue)) {