small fix for auto-decimal place
Kevin Finn
kevinfinn@mediaone.net
Tue, 23 Jan 2001 00:25:44 -0600
This is a multi-part message in MIME format.
--------------3FFA6B0D6E302613461CB9B9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello,
Attached is a small patch that gets auto decimal place operation
working again. It looks like it was probably broken by the change to
using gnc_numeric. I would have updated this at the time, but due to
other commitments I haven't been following Gnucash development very
closely for the last few months, and in fact couldn't get Gnucash to
compile again until recently to notice that it wasn't working.
Thanks,
Kevin
--
Kevin Finn
kevinfinn@mediaone.net
--------------3FFA6B0D6E302613461CB9B9
Content-Type: text/plain; charset=us-ascii;
name="gnc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="gnc.diff"
# This is a patch for gnucash to update it to my-gnucash
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -u 'gnucash/src/gnc-ui-util.c' 'my-gnucash/src/gnc-ui-util.c'
Index: ./src/gnc-ui-util.c
--- ./src/gnc-ui-util.c Wed Dec 20 04:45:49 2000
+++ ./src/gnc-ui-util.c Tue Jan 23 00:15:04 2001
@@ -1508,14 +1508,15 @@
}
else if (auto_decimal_enabled && !got_decimal)
{
- /* No decimal point and auto decimal point enabled, so assume
- * that the value is an integer number of cents or a cent-type
- * unit. For each auto decimal place requested, move the final
- * decimal point one place to the left. */
if ((auto_decimal_places > 0) && (auto_decimal_places < 9))
{
denom = multiplier(auto_decimal_places);
- numer *= denom;
+
+ /* No need to multiply numer by denom at this point,
+ * since by specifying the auto decimal places the
+ * user has effectively determined the scaling factor
+ * for the numerator they entered.
+ */
}
}
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Tue Jan 23 00:15:32 2001
# Generated by : makepatch 2.00_03
# Recurse directories : Yes
# Excluded files : (\A|.*/)CVS(/.*|\Z)
# (\A|.*/)RCS(/.*|\Z)
# ,v\Z
# (\A|.*/)SCCS(/.*|\Z)
# (\A|.*/)[sp]\..+\Z
# (\A|/)\#.*\#\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.bin\Z
# (\A|/).*\.diff\Z
# (\A|/).*\.diffs\Z
# (\A|/).*\.gmo\Z
# (\A|/).*\.lo\Z
# (\A|/).*\.log\Z
# (\A|/).*\.mo\Z
# (\A|/).*\.moc\Z
# (\A|/).*\.o\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.patch\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.tar\.gz\Z
# (\A|/).*\.wrap\Z
# (\A|/).*\.xac\..*\.xac\Z
# (\A|/)\.\#.*\Z
# (\A|/)\.deps\Z
# (\A|/)\.libs\Z
# (\A|/)Makefile\Z
# (\A|/)Makefile\.in\Z
# (\A|/)Makefile\.init\Z
# (\A|/)POTFILES\Z
# (\A|/)TAGS\Z
# (\A|/)aclocal\.m4\Z
# (\A|/)cat\-id\-tbl\.c\Z
# (\A|/)conf\.h\Z
# (\A|/)config\.cache\Z
# (\A|/)config\.guess\Z
# (\A|/)config\.h\Z
# (\A|/)config\.log\Z
# (\A|/)config\.status\Z
# (\A|/)config\.sub\Z
# (\A|/)configure\Z
# (\A|/)doc\/sgml\/C\/gnucash\/.*\Z
# (\A|/)doc\/sgml\/C\/gnucash\.junk\Z
# (\A|/)errs.*\Z
# (\A|/)g\-wrap\-guile\Z
# (\A|/)g\-wrap\.info\Z
# (\A|/)gnc\-autogen\.h\Z
# (\A|/)gnucash\-design\.html\Z
# (\A|/)gnucash\-engine\-perl5_wrap\.c\Z
# (\A|/)gnucash\-engine\-perl5_wrap_int\.c\Z
# (\A|/)gnucash\.engine\.i\Z
# (\A|/)gnucash\.pm\Z
# (\A|/)gnucash\.pot\Z
# (\A|/)intl\/libintl\.h\Z
# (\A|/)intl\/po2tbl\.sed\Z
# (\A|/)lib\/finance\-quote\/blib\Z
# (\A|/)lib\/finance\-quote\/pm_to_blib\Z
# (\A|/)libgncengine\.la\Z
# (\A|/)libgwrapguile\.la\Z
# (\A|/)libgwraprs\.la\Z
# (\A|/)libtool\Z
# (\A|/)ltconfig\Z
# (\A|/)ltmain\.sh\Z
# (\A|/)make\-gnucash\-patch\Z
# (\A|/)stamp\-h\.in\Z
# (\A|/)po\/extract\-macros\.perl\Z
# (\A|/)po\/pseudo\-source\.c\Z
# (\A|/)rpm\/gnucash\.spec\Z
# (\A|/)src\/doc\/design\/gnucash\-design\.info\Z
# (\A|/)src\/doc\/design\/gnucash\-design\.info\-1\Z
# (\A|/)src\/doc\/design\/gnucash\-design\.info\-2\Z
# (\A|/)src\/doc\/design\/stamp\-vti\Z
# (\A|/)src\/doc\/design\/version\.texi\Z
# (\A|/)src\/gnome\/glade\-cb\-gnc\-dialogs\.c\Z
# (\A|/)src\/gnome\/glade\-support\-gnc\-dialogs\.c\Z
# (\A|/)src\/gnucash\Z
# (\A|/)src\/guile\/gnc\.c\Z
# (\A|/)src\/guile\/gnc\.h\Z
# (\A|/)src\/guile\/gnc\.html\Z
# (\A|/)src\/guile\/gnucash\.c\Z
# (\A|/)src\/guile\/i18n\.h\Z
# (\A|/)src\/optional\/swig\/gnucash\.engine_wrap\.doc\Z
# (\A|/)src\/optional\/swig\/libgncswig\.la\Z
# (\A|/)src\/quotes\/gnc\-prices\Z
# (\A|/)src\/scm\/bootstrap\.scm\Z
# (\A|/)doc\/sgml\/C\/gnucash\Z
# (\A|/)stamp\-cat\-id\Z
# (\A|/)stamp\-h\Z
# p 'src/gnc-ui-util.c' 38152 980230504 0100664
#### End of ApplyPatch data ####
#### End of Patch kit [created: Tue Jan 23 00:15:32 2001] ####
#### Patch checksum: 125 5590 22228 ####
#### Checksum: 143 6269 13250 ####
--------------3FFA6B0D6E302613461CB9B9--