WHY: XML file contains -35.359999999999999 for a -35.36 amount

Created by Maxime DOYEN
Keywords:
XML amount digit
Last updated by:
Maxime DOYEN

HomeBank uses glib function g_ascii_dtostr/g_ascii_strtod to store amount info the XML file.

from glib documentation:
"This function generates enough precision that converting the string back using g_ascii_strtod() gives the same machine-number (on machines with IEEE compatible 64bit doubles)."

the 16 precision digits are sufficient for most currencies, even the crypto, which have only 8 significant digits.