misc fixes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@297 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1997-12-06 03:19:09 +00:00
parent 6d84011e0d
commit 81b59c3cd8
2 changed files with 16 additions and 9 deletions

View File

@ -108,6 +108,7 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
int i, j, k, currow;
char buf[BUFSIZE];
char *amt;
/* Add all the top-level accounts to the list */
for( i=0; i<grp->numAcc; i++ )
@ -145,11 +146,8 @@ xaccMainWindowAddAcct (Widget acctrix, AccountGroup *grp, int depth )
(INCOME == acc->type) ) {
dbalance = -dbalance;
}
if( 0.0 > dbalance )
sprintf( buf,"-$%.2f", DABS(dbalance) );
else
sprintf( buf,"$%.2f", DABS(dbalance) );
cols[XACC_MAIN_ACC_BALN] = XtNewString(buf);
amt = xaccPrintAmount (dbalance, PRTSYM);
cols[XACC_MAIN_ACC_BALN] = XtNewString(amt);
XtVaGetValues (acctrix, XmNrows, &currow, NULL);
XbaeMatrixAddRows( acctrix, currow, cols, NULL, NULL, 1 );
@ -791,6 +789,7 @@ xaccMainWindowRedisplayBalance (void)
double assets = 0.0;
double profits = 0.0;
char buf[BUFSIZE];
char * amt;
AccountGroup *grp = topgroup;
Account *acc;
@ -823,8 +822,12 @@ xaccMainWindowRedisplayBalance (void)
}
}
sprintf( buf, "$ %.2f\n$ %.2f", assets, profits);
amt = xaccPrintAmount (assets, PRTSYM);
strcpy (buf, amt);
strcat (buf, "\n");
amt = xaccPrintAmount (profits, PRTSYM);
strcat (buf, amt);
XmTextSetString( baln_widget, buf );
}

View File

@ -1107,8 +1107,12 @@ regRecalculateBalance( RegWindow *regData )
}
}
if( NULL != regData->balance ) {
sprintf( buf, "$ %.2f\n$ %.2f",
prt_balance, prt_clearedBalance );
char * amt;
amt = xaccPrintAmount (prt_balance, PRTSYM);
strcpy (buf, amt);
strcat (buf, "\n");
amt = xaccPrintAmount (prt_clearedBalance, PRTSYM);
strcat (buf, amt);
XmTextSetString( regData->balance, buf );
}