guibranco / MaxiPago-SDK-dotnet

💳 ⚙️ MaxiPago gateway SDK for .NET projects
https://guibranco.github.io/MaxiPago-SDK-dotnet/
MIT License
3 stars 2 forks source link

[BUG] The use of Thread.CurrentThread.CurrentCulture = "en-US", change the location for all application #139

Closed fsbflavio closed 4 months ago

fsbflavio commented 5 months ago

Description

I notice that the code sets Thread.CurrentThread.CurrentCulture to "en-US" (Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US")) which changes the current thread's culture to English (United States). This causes issues when the component is used in other locations with different cultures.

I couldn't understand the purpose of changes Current Thread culture, as a suggestion for a solution would just be to remove the lines.

If necessary, instead of change the current thread culture, it’s better to handle culture-specific formatting at the application level or pass culture information as a parameter using CultureInfo:

CultureInfo culture = new CultureInfo("en-US");
var formattedValue = valuel.ToString("C", culture);

Screenshots

No response

Additional information

No response

gitauto-ai[bot] commented 5 months ago

Hello @guibranco, you have reached your request limit of 5, your cycle will refresh on 2024-07-21 10:07:38. Consider subscribing if you want more requests. If you have any questions or concerns, please contact us at info@gitauto.ai.