#include "fb.h"
#include <math.h>
Go to the source code of this file.
|
#define | FB_MAXFIXLEN 19 /* floor( log10( pow( 2.0, 63 ) ) ) + 1 */ |
|
|
static void | fb_hGetNumberParts (double number, char *pachFixPart, ssize_t *pcchLenFix, char *pachFracPart, ssize_t *pcchLenFrac, char *pchSign, char chDecimalPoint, int precision) |
| Splits a number into its fixed and fractional part. More...
|
|
static FBSTRING * | fb_hBuildDouble (double num, char decimal_point, char thousands_separator) |
|
static double | hRound (double value, const FormatMaskInfo *pInfo) |
|
static int | fb_hProcessMask (FBSTRING *dst, const char *mask, ssize_t mask_length, double value, FormatMaskInfo *pInfo, char chThousandsSep, char chDecimalPoint, char chDateSep, char chTimeSep) |
| Processes a FORMAT mask. More...
|
|
FBCALL FBSTRING * | fb_hStrFormat (double value, const char *mask, size_t mask_length) |
|
FBCALL FBSTRING * | fb_StrFormat (double value, FBSTRING *mask) |
|
#define FB_MAXFIXLEN 19 /* floor( log10( pow( 2.0, 63 ) ) ) + 1 */ |
Enumerator |
---|
eMT_Unknown |
|
eMT_Number |
|
eMT_DateTime |
|
Definition at line 6 of file str_format.c.
static FBSTRING* fb_hBuildDouble |
( |
double |
num, |
|
|
char |
decimal_point, |
|
|
char |
thousands_separator |
|
) |
| |
|
static |
static void fb_hGetNumberParts |
( |
double |
number, |
|
|
char * |
pachFixPart, |
|
|
ssize_t * |
pcchLenFix, |
|
|
char * |
pachFracPart, |
|
|
ssize_t * |
pcchLenFrac, |
|
|
char * |
pchSign, |
|
|
char |
chDecimalPoint, |
|
|
int |
precision |
|
) |
| |
|
static |
Splits a number into its fixed and fractional part.
precision info 11 VBDOS' default floating point precision for FORMAT$() when no mask was specified 16 Precision when the user specified a mask
Definition at line 44 of file str_format.c.
static int fb_hProcessMask |
( |
FBSTRING * |
dst, |
|
|
const char * |
mask, |
|
|
ssize_t |
mask_length, |
|
|
double |
value, |
|
|
FormatMaskInfo * |
pInfo, |
|
|
char |
chThousandsSep, |
|
|
char |
chDecimalPoint, |
|
|
char |
chDateSep, |
|
|
char |
chTimeSep |
|
) |
| |
|
static |
Processes a FORMAT mask.
This function is used for two passes:
- Determine the required size of the resulting string.
- Build the resulting string.
This function is a mess, but hey, it works ...
When I've too much time, I'll simplify this function so that almost all queries of do_output will be removed.
Definition at line 227 of file str_format.c.
FBCALL FBSTRING* fb_hStrFormat |
( |
double |
value, |
|
|
const char * |
mask, |
|
|
size_t |
mask_length |
|
) |
| |