AUDIT: r17429 - gnucash/trunk/src - Bug #309863, #341362: Prevent rounding when entering prices in the Price Editor and Stock Split druid, but also avoid fractional display if it is unnecessary.
Charles Day
cedayiv at cvs.gnucash.org
Sun Jul 27 15:51:19 EDT 2008
Author: cedayiv
Date: 2008-07-27 15:51:19 -0400 (Sun, 27 Jul 2008)
New Revision: 17429
Trac: http://svn.gnucash.org/trac/changeset/17429
Modified:
gnucash/trunk/src/app-utils/gnc-ui-util.c
gnucash/trunk/src/gnome/dialog-price-editor.c
gnucash/trunk/src/gnome/druid-stock-split.c
Log:
Bug #309863, #341362: Prevent rounding when entering prices in the Price Editor and Stock Split druid, but also avoid fractional display if it is unnecessary.
BP
Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c 2008-07-27 16:57:58 UTC (rev 17428)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c 2008-07-27 19:51:19 UTC (rev 17429)
@@ -1383,7 +1383,7 @@
/* at this point, buf contains the whole part of the number */
/* If it's not decimal, print the fraction as an expression */
- if (!is_decimal_fraction (val.denom, NULL))
+ if (!gnc_numeric_to_decimal(&val, NULL))
{
if (!gnc_numeric_zero_p (val))
{
Modified: gnucash/trunk/src/gnome/dialog-price-editor.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-editor.c 2008-07-27 16:57:58 UTC (rev 17428)
+++ gnucash/trunk/src/gnome/dialog-price-editor.c 2008-07-27 19:51:19 UTC (rev 17429)
@@ -368,7 +368,6 @@
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (w), TRUE);
print_info = gnc_default_price_print_info ();
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
- gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (w), 1000000);
gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
gtk_widget_show (w);
label = glade_xml_get_widget (xml, "price_label");
Modified: gnucash/trunk/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/trunk/src/gnome/druid-stock-split.c 2008-07-27 16:57:58 UTC (rev 17428)
+++ gnucash/trunk/src/gnome/druid-stock-split.c 2008-07-27 19:51:19 UTC (rev 17429)
@@ -658,7 +658,6 @@
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
gnc_default_price_print_info ());
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (amount), TRUE);
- gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (amount), 1000000);
gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
info->price_edit = amount;
label = glade_xml_get_widget (xml, "price_label");
More information about the gnucash-changes
mailing list