mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Limit the range of the random value to 1..1000 to prevent overflows, particularly in number-of-periods or number-of-years variables. While we're at it, g_random_int and g_random_int_range return ints so piping the result through gnc_double_to_numeric() doesn't make much sense. That's removed, we just construct a gnc_numeric.
After loading this module, you must also call (gnc:setup-gettext) (setlocale LC_ALL "") at some point to finish initializing the app. This is not done automatically from gncmod-app-utils.c via app-utils.scm because you may need to handle setlocale yourself (or you may already have other code that does).