Hi,
We have a working xml import with the xml DOM objects. Originally the codeunit was written in a Belgian NAV. Number where read correctly. Now the same codeunit is in a UK Nav DB, running on a pc with locale UK. Numbers are wrong.
This is the XML:
<PROPERTY PROP_NAME="NETAMOUNT1">3173.25</PROPERTY>
In the BE DB this imports as 3.173,25 => Correct
In the UK it imports as 317,325.00 => Wrong
Why?
Comments
check the code how they are assigning the amount. If they are using format, you can write your own code.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Since in BE the decimal sign is "," this works. but for UK, a "," represents the thousand separator, hence wrong...
So, this would work in UK:
But how to get it right under all circumstances?
DELCHR(FORMAT(0.1),'=','01') - result is '.' or ',' depending on local settings
CONVERTSTR(MyDecimalText,'.',DELCHR(FORMAT(0.1),'=','01')) - replacing '.' (decimal separator in XML) by '.' or ',' depending on local settings
EVALUATE(..) - you know what it does... ;-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.