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


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17429 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day 2008-07-27 19:51:19 +00:00
parent 83de1c0bbc
commit 9085dadcfa
3 changed files with 1 additions and 3 deletions

View File

@ -1383,7 +1383,7 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
/* 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))
{

View File

@ -368,7 +368,6 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
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");

View File

@ -658,7 +658,6 @@ gnc_stock_split_druid_create (StockSplitInfo *info)
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");