Top | ![]() |
![]() |
![]() |
![]() |
void go_render_general (PangoLayout *layout
,GString *str
,GOFormatMeasure measure
,const GOFontMetrics *metrics
,double val
,int col_width
,gboolean unicode_minus
);
void go_render_generall (PangoLayout *layout
,GString *str
,GOFormatMeasure measure
,const GOFontMetrics *metrics
,long double val
,int col_width
,gboolean unicode_minus
);
GOFormat * go_format_new_markup (PangoAttrList *markup
,gboolean add_ref
);
If add_ref
is FALSE absorb the reference to markup
, otherwise add a
reference.
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_details_init (GOFormatDetails *details
,GOFormatFamily family
);
void go_format_generate_str (GString *dst
,GOFormatDetails const *details
);
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.
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.
void
go_format_unref (GOFormat const *fmt
);
Removes a reference to fmt
, freeing when it goes to zero.
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
);
void go_format_get_details (GOFormat const *fmt
,GOFormatDetails *dst
,gboolean *exact
);
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
);
char * go_format_value (GOFormat const *fmt
,double val
);
Converts val
into a string using format specified by fmt
.
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
);
GOFormat *
go_format_inc_precision (GOFormat const *fmt
);
Increases the displayed precision for fmt
by one digit.
GOFormat *
go_format_dec_precision (GOFormat const *fmt
);
Decreases the displayed precision for fmt
by one digit.
gboolean go_format_output_to_odf (GsfXMLOut *xout
,GOFormat const *fmt
,int cond_part
,char const *name
,gboolean with_extension
);
typedef struct { gchar const *symbol; gchar const *description; gboolean precedes; gboolean has_space; } GOFormatCurrency;
typedef struct { GOFormatFamily family; GOFormatMagic magic; /* NUMBER, SCIENTIFIC, CURRENCY, ACCOUNTING, 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; gboolean use_markup; gboolean simplify_mantissa; } GOFormatDetails;