1
DoubleFormatOverride does not work
Problem reported by Sivaprasath MANIVANNAN - 1/30/2023 at 1:36 PM
Resolved
When converting LXO generated C# objects to string, I would like to print the full 17 digits that the double value holds internally. Below is my code with double format override but it still rounds off the double to 15 digits in the output string.

using (StringWriterWithEncoding sw = new StringWriterWithEncoding(Encoding.UTF8))
{
    var serializer = new LxSerializer<KWKA_ExchangeElm>();
    var settings = new LxWriterSettings()
                   {
                       DoubleFormatOverride "G17"
                   };
    serializer.Serialize(sw, kwkaExchange, settings);
    return sw.ToString();
}
Am I missing something here?

Thanks,

3 Replies

Reply to Thread
0
Liquid Support Replied
Employee Post
Hi,

It looks like the FloatFormatOverride is getting used for both Float and Double, so as a work around you could set that to FloatFormatOverride = "G17" (unless you are also using floats in your XSD).

You can also set the numericPattern in a caddy file as described in the documentation 'Customizing the generated code with Override Values':

This issue is fixed in the next point release, due for release later this week.
0
Liquid Support Replied
Employee Post Marked As Resolution
This issue has now been fixed in v20.2.4:
0
Sivaprasath MANIVANNAN Replied
Thanks for quick response. It solves the issue for us.

Reply to Thread