Hi MariaDB Developers,

I have an application which depends on the formatting MariaDB applies to a double when assigned to a char/varchar column of different lengths, and am trying to reproduce the behaviour in PHP. I have gotten some way but just can't seem to get the rules right.

I'm having trouble finding a specification for this in the docs or the code that is responsible for this in the MariaDB source. Can someone point me in the right direction?

Thanks