mirror of
				https://github.com/Gnucash/gnucash.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	[gnc-ui-util] add gnc_price_print_info
similar to gnc_default_price_print_info but also accepts a use_symbol specifier. for generating print_info for prices, either exact e.g. $1 + 2/3, or inexact e.g. $1.3333
This commit is contained in:
		@@ -111,6 +111,8 @@ GNCPrintAmountInfo gnc_account_print_info (const Account *account,
 | 
			
		||||
        gboolean use_symbol);
 | 
			
		||||
GNCPrintAmountInfo gnc_commodity_print_info (const gnc_commodity *commodity,
 | 
			
		||||
        gboolean use_symbol);
 | 
			
		||||
GNCPrintAmountInfo gnc_price_print_info (const gnc_commodity *curr,
 | 
			
		||||
        gboolean use_symbol);
 | 
			
		||||
GNCPrintAmountInfo gnc_share_print_info_places (int decplaces);
 | 
			
		||||
const char * xaccPrintAmount (gnc_numeric val, GNCPrintAmountInfo info);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1482,7 +1482,7 @@ gnc_share_print_info_places (int decplaces)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GNCPrintAmountInfo
 | 
			
		||||
gnc_default_price_print_info (const gnc_commodity *curr)
 | 
			
		||||
gnc_price_print_info (const gnc_commodity *curr, gboolean use_symbol)
 | 
			
		||||
{
 | 
			
		||||
    GNCPrintAmountInfo info;
 | 
			
		||||
    gboolean force = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
 | 
			
		||||
@@ -1504,7 +1504,7 @@ gnc_default_price_print_info (const gnc_commodity *curr)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    info.use_separators = 1;
 | 
			
		||||
    info.use_symbol = 0;
 | 
			
		||||
    info.use_symbol = use_symbol ? 1 : 0;
 | 
			
		||||
    info.use_locale = 1;
 | 
			
		||||
    info.monetary = 1;
 | 
			
		||||
    
 | 
			
		||||
@@ -1513,6 +1513,13 @@ gnc_default_price_print_info (const gnc_commodity *curr)
 | 
			
		||||
    return info;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GNCPrintAmountInfo
 | 
			
		||||
gnc_default_price_print_info (const gnc_commodity *curr)
 | 
			
		||||
{
 | 
			
		||||
    return gnc_price_print_info (curr, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GNCPrintAmountInfo
 | 
			
		||||
gnc_integral_print_info (void)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -303,6 +303,9 @@ GNCPrintAmountInfo gnc_account_print_info (const Account *account,
 | 
			
		||||
GNCPrintAmountInfo gnc_split_amount_print_info (Split *split,
 | 
			
		||||
        gboolean use_symbol);
 | 
			
		||||
 | 
			
		||||
GNCPrintAmountInfo gnc_price_print_info (const gnc_commodity *curr,
 | 
			
		||||
        gboolean use_symbol);
 | 
			
		||||
 | 
			
		||||
GNCPrintAmountInfo gnc_share_print_info_places (int decplaces);
 | 
			
		||||
GNCPrintAmountInfo gnc_default_share_print_info (void);
 | 
			
		||||
GNCPrintAmountInfo gnc_default_price_print_info (const gnc_commodity *curr);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user