Hi,
I have several API methods which are using
num2str(num,0,2,0,0)))
as number to string conversion. It worked fine in 2009 returning proper locale settings based
on windows settings, but in D365 does it does not seem to be the case. When I currently use
it . (dot) as separator is returned. If I change 0 to 99 then , (coma) as separator is returned.
Now the question is - from where exactly locale settings are taken from to do the conversion?
I've tried user setting and local server settings, but it didn't change the result.
This is exactly what we are going to do - add additional parameter to have control over conversion.
Instead of using num2str directly, you can open a field in the parameter tables, add a method to the global and manage the situation
Or you can import the value from outside instead of using constant value(1/2)
We're in EU, so coma is used for our customers, at least for now. I was simply wondering if it's possible to have it more flexible if UK customer would appear one day.
I don't know, but I think you should just specify what you want and not trust "Auto" in integrations.
Can we solve your business requirement by specifically telling the function what kind of format we want?
Hi Nikolaos,
User settings work fine for the GUI, but it seems that not that good for the APIs. I have Azure app running on user with DA number format (which uses , as separator), I've changed num2str so 99 are now used. API returns values with coma. If I change settings on that user to en-US still coma is returned as separator. What am I missing?
Hi,
by looking at the documentation, I don't think that 0 is a supported value for decimal separator. I'm not sure what settings the Auto option is using, I would assume it uses the settings of the current user. Just like the number formatting on all D365 forms uses the user's settings to format the values.
You can provide 1, 2 or 99 as the decimal separator option, but 0 is not one of the supported values. 99 means Auto, 1 means Dot and 2 means Comma.
Thousand separator has a bit more options, but you can find them all in AOT under System documentation -> Base enums -> ThousandSeparator (the decimal separator is using DecimalSeparator enum).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,902 Super User 2024 Season 2
Martin Dráb 229,336 Most Valuable Professional
nmaenpaa 101,156