Skip to content

Commit

Permalink
Improve id inference (#8379) (#8382)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Bernd <[email protected]>
  • Loading branch information
github-actions[bot] and flobernd authored Oct 11, 2024
1 parent a484f00 commit 06f0486
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Collections.Concurrent;
using System.Globalization;
using System.Reflection;

#if ELASTICSEARCH_SERVERLESS
Expand Down Expand Up @@ -71,7 +72,7 @@ public string Resolve(Type type, object @object)
cachedLookup = o =>
{
var v = func(o);
return v?.ToString();
return (v is IFormattable f) ? f.ToString(null, CultureInfo.InvariantCulture) : v?.ToString();
};
if (preferLocal)
_localIdDelegates.TryAdd(type, cachedLookup);
Expand Down

0 comments on commit 06f0486

Please sign in to comment.