| Top |  |  |  |  | 
| #define | GO_SUBSCRIPT_RISE | 
| #define | GO_SUBSCRIPT_SCALE | 
| #define | GO_SUPERSCRIPT_RISE | 
| #define | GO_SUPERSCRIPT_SCALE | 
| GOFormat | |
| GOFormatCurrency | |
| GOFormatDetails | |
| enum | GOFormatFamily | 
| enum | GOFormatMagic | 
| enum | GOFormatNumberError | 
GOFormat *
go_format_dec_precision (GOFormat const *fmt);
Decreases the displayed precision for fmt
 by one digit.
void go_format_details_init (GOFormatDetails *details,GOFormatFamily family);
void go_format_foreach (GHFunc func,gpointer user_data);
Executes func
 for each registered GOFormat
void go_format_generate_number_str (GString *dst,int min_digits,int num_decimals,gboolean thousands_sep,gboolean negative_red,gboolean negative_paren,const char *prefix,const char *postfix);
Generates a format string for a number format with the given
parameters and appends it to dst
.
| dst | GString to append format string to. | |
| min_digits | minimum number of digits before decimal separator. | |
| num_decimals | number of decimals | |
| thousands_sep | if true, use a thousands separator. | |
| negative_red | if true, make negative values red. | |
| negative_paren | if true, enclose negative values in parentheses. | |
| prefix | optional string to place before number part of the format | |
| postfix | optional string to place after number part of the format | 
void go_format_generate_str (GString *dst,GOFormatDetails const *details);
void go_format_get_details (GOFormat const *fmt,GOFormatDetails *dst,gboolean *exact);
GOFormat *
go_format_inc_precision (GOFormat const *fmt);
Increases the displayed precision for fmt
 by one digit.
GOFormat * go_format_new_markup (PangoAttrList *markup,gboolean add_ref);
If add_ref
 is FALSE absorb the reference to markup
, otherwise add a
reference.
gboolean go_format_output_to_odf (GsfXMLOut *xout,GOFormat const *fmt,int cond_part,char const *name,gboolean with_extension);
const GOFormat * go_format_specialize (GOFormat const *fmt,double val,char type,gboolean *inhibit_minus);
const GOFormat * go_format_specializel (GOFormat const *fmt,long double val,char type,gboolean *inhibit_minus);
char *
go_format_str_delocalize (char const *str);
De-localizes the given format string, i.e., changes locale's decimal separators to dots and performs other such transformations.
char *
go_format_str_localize (char const *str);
Localizes the given format string, i.e., changes decimal dots to the locale's notion of that and performs other such transformations.
void
go_format_unref (GOFormat const *fmt);
Removes a reference to fmt
, freeing when it goes to zero.
char * go_format_value (GOFormat const *fmt,double val);
Converts val
 into a string using format specified by fmt
.
GOFormatNumberError go_format_value_gstring (PangoLayout *layout,GString *str,const GOFormatMeasure measure,const GOFontMetrics *metrics,GOFormat const *fmt,double val,char type,const char *sval,GOColor *go_color,int col_width,GODateConventions const *date_conv,gboolean unicode_minus);
Render a floating-point value into layout
 in such a way that the
layouting width does not needlessly exceed col_width
.  Optionally
use unicode minus instead of hyphen.
| layout | Optional PangoLayout, probably preseeded with font attribute. | |
| str | a GString to store (not append!) the resulting string in. | |
| measure | Function to measure width of string/layout. | [scope call] | 
| metrics | Font metrics corresponding to  | |
| fmt | ||
| val | floating-point value. Must be finite. | |
| type | a format character | |
| sval | a string to append to  | |
| go_color | a color to rende | |
| col_width | intended max width of layout in pango units. -1 means no restriction. | |
| date_conv | ||
| unicode_minus | Use unicode minuses, not hyphens. | 
GOFormatNumberError go_format_value_gstringl (PangoLayout *layout,GString *str,const GOFormatMeasure measure,const GOFontMetrics *metrics,GOFormat const *fmt,long double val,char type,const char *sval,GOColor *go_color,int col_width,GODateConventions const *date_conv,gboolean unicode_minus);
Render a floating-point value into layout
 in such a way that the
layouting width does not needlessly exceed col_width
.  Optionally
use unicode minus instead of hyphen.
| layout | Optional PangoLayout, probably preseeded with font attribute. | |
| str | a GString to store (not append!) the resulting string in. | |
| measure | Function to measure width of string/layout. | [scope call] | 
| metrics | Font metrics corresponding to  | |
| fmt | ||
| val | floating-point value. Must be finite. | |
| type | a format character | |
| sval | a string to append to  | |
| go_color | a color to rende | |
| col_width | intended max width of layout in pango units. -1 means no restriction. | |
| date_conv | ||
| unicode_minus | Use unicode minuses, not hyphens. | 
void go_render_general (PangoLayout *layout,GString *str,GOFormatMeasure measure,const GOFontMetrics *metrics,double val,int col_width,gboolean unicode_minus,guint numeral_shape,guint custom_shape_flags);
Render a floating-point value into layout
 in such a way that the
layouting width does not needlessly exceed col_width
.  Optionally
use unicode minus instead of hyphen.
| layout | Optional PangoLayout, probably preseeded with font attribute. | |
| str | a GString to store (not append!) the resulting string in. | |
| measure | Function to measure width of string/layout. | [scope call] | 
| metrics | Font metrics corresponding to  | |
| val | floating-point value. Must be finite. | |
| col_width | intended max width of layout in the units that  | |
| unicode_minus | Use unicode minuses, not hyphens. | |
| numeral_shape | numeral shape identifier. | |
| custom_shape_flags | flags for using  | 
void go_render_generall (PangoLayout *layout,GString *str,GOFormatMeasure measure,const GOFontMetrics *metrics,long double val,int col_width,gboolean unicode_minus,guint numeral_shape,guint custom_shape_flags);
Render a floating-point value into layout
 in such a way that the
layouting width does not needlessly exceed col_width
.  Optionally
use unicode minus instead of hyphen.
| layout | Optional PangoLayout, probably preseeded with font attribute. | |
| str | a GString to store (not append!) the resulting string in. | |
| measure | Function to measure width of string/layout. | [scope call] | 
| metrics | Font metrics corresponding to  | |
| val | floating-point value. Must be finite. | |
| col_width | intended max width of layout in the units that  | |
| unicode_minus | Use unicode minuses, not hyphens. | |
| numeral_shape | numeral shape identifier. | |
| custom_shape_flags | flags for using  | 
typedef struct {
	gchar const *symbol;
	gchar const *description;
	gboolean precedes;
	gboolean has_space;
} GOFormatCurrency;
typedef struct {
	GOFormatFamily family;
	GOFormatMagic magic;
	/* NUMBER, SCIENTIFIC, CURRENCY, ACCOUNTING, FRACTION, PERCENTAGE: */
	int min_digits;
	int num_decimals;
	/* NUMBER, CURRENCY, ACCOUNTING, PERCENTAGE: */
	gboolean thousands_sep;
	/* NUMBER, CURRENCY, ACCOUNTING, PERCENTAGE: */
	gboolean negative_red;
	gboolean negative_paren;
	/* CURRENCY, ACCOUNTING: */
	GOFormatCurrency const *currency;
	/* CURRENCY: */
	gboolean force_quoted;
	/* SCIENTIFIC: */
	int exponent_step;
	int exponent_digits;
	gboolean exponent_sign_forced;
	gboolean use_markup;
	gboolean simplify_mantissa;
	gboolean append_SI;
	gchar *appended_SI_unit;
	int scale;
	/* FRACTION: */
	gboolean automatic_denominator;
	gboolean split_fraction;
	gboolean pi_scale;
	int numerator_min_digits;
	int denominator_min_digits;
	int denominator_max_digits;
	int denominator;
} GOFormatDetails;
| GOFormatFamily  | ||
| GOFormatMagic  | ||
| minimum digits number. | ||
| decimals number. | ||
| thousands separator. | ||
| display negative number using red ink. | ||
| uses parenthersis around negative numbers. | ||
| GOFormatCurrency const  * | ||
| force quotes use. | ||
| steps between allowed exponents in scientific notation. | ||
| digits number in exponent. | ||
| whether the sign in the exponent is always shown. | ||
| whether to use a markup. | ||
| simplify the mantissa. | ||
| append an SI unit. | ||
| the SI unit to append. | ||
| scale. | ||
| use an automatic denominator for fractions. | ||
| split the fraction. | ||
| use multiples of pi for fractions, e.g. 1/2*pi. | ||
| minimum digits number for the numerator. | ||
| minimum digits number for the denominator. | ||
| minimum digits number for the denominator. | ||
| fixed denominator. |