GNOME Bugzilla – Bug 644036
Bug with number format in Counters settings
Last modified: 2018-06-29 22:54:33 UTC
Hi Under File -> Properties -> Counters its a bug with the number format. If i fill in "Test - %I64i" it dont work. Trace log: Invalid counter format string. Format string: 'Test - %I64i' Counter: 'gncCustomer' Error: 'Invalid length modifier and/or conversion specifier ('i'), it should be: I64i') Tested on Windows 7 64-bit and Windows Server 2008 32-bit. Same error on both.
@Matthijs: The printf() number formats for 64-bit integers on windows are different from the ones under unix. Do you have an idea on how to fix this issue on windows? @stenilsen: Why do you use %I64i anyway? I thought %d would have been fine. The underlying integer number is probably a plain 32 bit integer, so we don't need to use the 64-bit integer conversion anyway. Or do I miss something here? Thanks for reporting this of course!
(In reply to comment #1) > @Matthijs: The printf() number formats for 64-bit integers on windows are > different from the ones under unix. Do you have an idea on how to fix this > issue on windows? > @stenilsen: Why do you use %I64i anyway? I thought %d would have been fine. The > underlying integer number is probably a plain 32 bit integer, so we don't need > to use the 64-bit integer conversion anyway. Or do I miss something here? > Thanks for reporting this of course! "Test - %d" gives trace log: [qof_book_get_counter_format()] Invalid counter format string. Format string: 'Test - %d' Counter: 'gncCustomer' Error: 'Invalid length modifier and/or conversion specifier ('d'), it should be: I64i') * Tested %d on Windows 7 64-bit and Windows Server 2008 32-bit
@Matthijs: We have a problem here: The number conversion specifier is OS-specific but also stored in the book. This will fail as soon as the book is accessed from differents OSes one after the other. Unfortunately gnucash will have to provide an abstraction from the OS's conversion specifier because otherwise this mechanism will fail each time you access the book file from a new OS. This error itself was caused by the fact that the conversion validation simply failed on windows, but I've fixed this in r20382. Thanks for reporting this.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=644036. Please update any external references or bookmarks.