-
damian jimenez
- PowerServer
- Thursday, 18 December 2025 12:50 PM UTC
CONTEXT:
-------------------------------------------------
There's a locale specification (comma and decimal point) that I need to implement in .NET after compilation to maintain the same content in a DataWindow when it's defined as type decimal(0). Otherwise, PowerServer crashes.
NOTE: In my case my regional culture is "es-AR"
This is due to how it handles types internally. For example, the content of 24 in PowerServer is 24.0000, which is interpreted as 24 million instead of 24.
What code should I add to the startup event so that it correctly uses the same value?
(Additional note: Changing from decimal(0) to real via Edit Source avoids the error, but it's a problem when you have thousands of DataWindows.)
(chat gpt response)
---------------------
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// 1. Define the desired culture (InvariantCulture uses the period as the decimal point)
var supportedCultures = new[] { "en-US" };
var localizationOptions = new RequestLocalizationOptions()
.SetDefaultCulture(supportedCultures[0])
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures);
/ // 2. Force the server's culture to be used instead of the browser's
localizationOptions.ApplyCurrentCultureToResponseHeaders = true;
app.UseRequestLocalization(localizationOptions);
/ ... rest of the configuration (UseRouting, UseAuthorization, etc.)
}
QUESTION:
-----------------------------
Is there a way to configure this beforehand from PowerBuilder so as not to modify the compiled program?
Thank you very much
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.