strconv #

fn atof64 #

fn atof64(s string) f64

atof64 return a f64 from a string doing a parsing operation

fn atof_quick #

fn atof_quick(s string) f64

atof_quick return a f64 number from a string in a quick way

fn atoi #

fn atoi(s string) ?int

atoi is equivalent to parse_int(s, 10, 0), converted to type int.

fn byte_to_lower #

fn byte_to_lower(c byte) byte

fn common_parse_int #

fn common_parse_int(_s string, base int, _bit_size int, error_on_non_digit bool, error_on_high_digit bool) i64

common_parse_int is called by parse int and allows the parsing to stop on non or invalid digit characters and return the result so far

fn common_parse_uint #

fn common_parse_uint(s string, _base int, _bit_size int, error_on_non_digit bool, error_on_high_digit bool) u64

common_parse_uint is called by parse_uint and allows the parsing to stop on non or invalid digit characters and return the result so far

fn common_parse_uint2 #

fn common_parse_uint2(s string, _base int, _bit_size int) (u64, int)

the first returned value contains the parsed value, the second returned value contains the error code (0 = OK, >1 = index of first non-parseable character + 1, -1 = wrong base, -2 = wrong bit size, -3 = overflow)

fn f32_to_decimal #

fn f32_to_decimal(mant u32, exp u32) Dec32

fn f32_to_str #

fn f32_to_str(f f32, n_digit int) string

f32_to_str return a string in scientific notation with max n_digit after the dot

fn f32_to_str_l #

fn f32_to_str_l(f f64) string

f32_to_str_l return a string with the f32 converted in a string in decimal notation

fn f32_to_str_pad #

fn f32_to_str_pad(f f32, n_digit int) string

f32_to_str return a string in scientific notation with max n_digit after the dot

fn f64_to_str #

fn f64_to_str(f f64, n_digit int) string

f64_to_str return a string in scientific notation with max n_digit after the dot

fn f64_to_str_l #

fn f64_to_str_l(f f64) string

f64_to_str_l return a string with the f64 converted in a string in decimal notation

fn f64_to_str_lnd #

fn f64_to_str_lnd(f f64, dec_digit int) string

max float 1.797693134862315708145274237317043567981e+308

fn f64_to_str_pad #

fn f64_to_str_pad(f f64, n_digit int) string

f64_to_str return a string in scientific notation with max n_digit after the dot

fn format_dec #

fn format_dec(d u64, p BF_param) string

max int64 9223372036854775807

fn format_es #

fn format_es(f f64, p BF_param) string

fn format_fl #

fn format_fl(f f64, p BF_param) string

fn format_int #

fn format_int(n i64, radix int) string

fn format_str #

fn format_str(s string, p BF_param) string

fn format_uint #

fn format_uint(n u64, radix int) string

format_uint returns the string representation of the number n in base radix for digit values > 10, this function uses the small latin leters a-z.

fn ftoa_32 #

fn ftoa_32(f f32) string

fn ftoa_64 #

fn ftoa_64(f f64) string

fn ftoa_long_32 #

fn ftoa_long_32(f f32) string

fn ftoa_long_64 #

fn ftoa_long_64(f f64) string

fn parse_int #

fn parse_int(_s string, base int, _bit_size int) i64

parse_int interprets a string s in the given base (0, 2 to 36) and bit size (0 to 64) and returns the corresponding value i. If the base argument is 0, the true base is implied by the string's prefix: 2 for "0b", 8 for "0" or "0o", 16 for "0x", and 10 otherwise. Also, for argument base 0 only, underscore characters are permitted as defined by the Go syntax for integer literals. The bitSize argument specifies the integer type that the result must fit into. Bit sizes 0, 8, 16, 32, and 64 correspond to int, int8, int16, int32, and int64. If bitSize is below 0 or above 64, an error is returned.

fn parse_uint #

fn parse_uint(s string, _base int, _bit_size int) u64

parse_uint is like parse_int but for unsigned numbers.

fn remove_tail_zeros #

fn remove_tail_zeros(s string) string

fn v_printf #

fn v_printf(str string, pt ...voidptr)

fn v_sprintf #

fn v_sprintf(str string, pt ...voidptr) string

fn (Dec32) get_string_32 #

fn (d Dec32) get_string_32(neg bool, i_n_digit int, i_pad_digit int) string

max 46 char -3.40282346638528859811704183484516925440e+38

struct BF_param #

struct BF_param {
	pad_ch       byte = byte(` `)
	len0         int  = -1
	len1         int  = 6
	positive     bool = true
	sign_flag    bool
	allign       Align_text = .right
	rm_tail_zero bool
}

struct PrepNumber #

struct PrepNumber {
pub mut:
	negative bool
	exponent int
	mantissa u64
}

The structure is filled by parser, then given to converter.