mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug fixes.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2489 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
b8f5a6b41f
commit
fcb4217d7e
@ -1,5 +1,8 @@
|
||||
2000-06-20 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/engine/util.c (xaccParseAmount): accept 8 decimal places
|
||||
instead of 6, and trucate if more than 8.
|
||||
|
||||
* src/gnome/dialog-add.c: make this window modeless.
|
||||
(gnc_ui_accWindow_ok_cb): don't let the user add an account with
|
||||
the same fully-qualified name as another account.
|
||||
|
@ -890,9 +890,22 @@ double xaccParseAmount (const char * instr, gncBoolean monetary)
|
||||
/* strip off garbage at end of the line */
|
||||
tok = strchr (str, ' ');
|
||||
if (tok) *tok = '\0';
|
||||
|
||||
|
||||
/* adjust for number of decimal places */
|
||||
len = strlen(str);
|
||||
|
||||
if (len > 8)
|
||||
{
|
||||
str[8] = '\0';
|
||||
len = 8;
|
||||
}
|
||||
|
||||
if (8 == len) {
|
||||
amount += 0.00000001 * ((double) atoi (str));
|
||||
} else
|
||||
if (7 == len) {
|
||||
amount += 0.0000001 * ((double) atoi (str));
|
||||
} else
|
||||
if (6 == len) {
|
||||
amount += 0.000001 * ((double) atoi (str));
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user