* src/gnome-utils/dialog-transfer.c: don't round the exchange

rate when returning it to callers...  Compute it from the
	  from_amount and to_amount.
	* src/register/ledger-core/split-register.c: change the rate-cell
	  to a shares_print_info so we don't lose accuracy due to rounding
	  errors.
	  Fixes bug #106332


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8003 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-02-18 06:25:15 +00:00
parent 07f29eae51
commit a3234ee702
3 changed files with 20 additions and 13 deletions

View File

@ -1,3 +1,13 @@
2003-02-17 Derek Atkins <derek@ihtfp.com>
* src/gnome-utils/dialog-transfer.c: don't round the exchange
rate when returning it to callers... Compute it from the
from_amount and to_amount.
* src/register/ledger-core/split-register.c: change the rate-cell
to a shares_print_info so we don't lose accuracy due to rounding
errors.
Fixes bug #106332
2003-02-16 David Hampton <hampton@employees.org> 2003-02-16 David Hampton <hampton@employees.org>
* src/quotes: List HTML::TableExtract as an explicit requirement, * src/quotes: List HTML::TableExtract as an explicit requirement,

View File

@ -1398,15 +1398,14 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
if (xferData->exch_rate) if (xferData->exch_rate)
{ {
/* If the to_amount is active, then call the callback, just in case the gnc_numeric to_amt, from_amt;
* user hit "return" -- because the exit-focus signal handler was probably
* not executed. from_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->amount_edit));
*/ to_amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(xferData->to_amount_edit));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (xferData->amount_radio)))
gnc_xfer_to_amount_update_cb(xferData->to_amount_edit, NULL, xferData);
*(xferData->exch_rate) = *(xferData->exch_rate) =
gnc_numeric_abs(gnc_amount_edit_get_amount(GNC_AMOUNT_EDIT(xferData->price_edit))); gnc_numeric_abs (gnc_numeric_div (to_amount, amount, GNC_DENOM_AUTO,
GNC_DENOM_REDUCE));
} }
else else
{ {

View File

@ -2101,14 +2101,12 @@ gnc_split_register_config_cells (SplitRegister *reg)
((PriceCell *) gnc_table_layout_get_cell (reg->table->layout, TSHRS_CELL), ((PriceCell *) gnc_table_layout_get_cell (reg->table->layout, TSHRS_CELL),
gnc_default_share_print_info ()); gnc_default_share_print_info ());
/* Initialize the rate cells */ /* Initialize the rate cell
gnc_price_cell_set_fraction * use a share_print_info to make sure we don't have rounding errors
((PriceCell *) */
gnc_table_layout_get_cell (reg->table->layout, RATE_CELL), 1000000);
gnc_price_cell_set_print_info gnc_price_cell_set_print_info
((PriceCell *) gnc_table_layout_get_cell (reg->table->layout, RATE_CELL), ((PriceCell *) gnc_table_layout_get_cell (reg->table->layout, RATE_CELL),
gnc_default_price_print_info()); gnc_default_share_print_info());
/* The action cell should accept strings not in the list */ /* The action cell should accept strings not in the list */
gnc_combo_cell_set_strict gnc_combo_cell_set_strict