After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644036 - Bug with number format in Counters settings
Bug with number format in Counters settings
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Windows
2.4.x
Other Windows
: Normal normal
: ---
Assigned To: Christian Stimming
Geert Janssens
Depends on:
Blocks:
 
 
Reported: 2011-03-06 17:38 UTC by stenilsen
Modified: 2018-06-29 22:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description stenilsen 2011-03-06 17:38:29 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.
Comment 1 Christian Stimming 2011-03-06 20:05:44 UTC
@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!
Comment 2 stenilsen 2011-03-06 21:51:39 UTC
(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
Comment 3 Christian Stimming 2011-03-08 11:17:29 UTC
@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.
Comment 4 John Ralls 2017-09-24 22:05:12 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 5 John Ralls 2018-06-29 22:54:33 UTC
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.