Next: Accessing Locale Information, Previous: Character Case Mapping, Up: Internationalization [Contents][Index]
The following procedures allow programs to read and write numbers
written according to a particular locale. As an example, in English,
“ten thousand and a half” is usually written 10,000.5
while
in French it is written 10 000,5
. These procedures allow such
differences to be taken into account.
Convert string str into an integer according to either
locale (a locale object as returned by make-locale
) or
the current process locale. If base is specified, then it
determines the base of the integer being read (e.g., 16
for an
hexadecimal number, 10
for a decimal number); by default,
decimal numbers are read. Return two values (see Multiple Values): an integer (on success) or #f
, and the number of
characters read from str (0
on failure).
This function is based on the C library’s strtol
function
(see strtol
in The GNU C Library
Reference Manual).
Convert string str into an inexact number according to either
locale (a locale object as returned by make-locale
) or
the current process locale. Return two values (see Multiple Values): an inexact number (on success) or #f
, and the number
of characters read from str (0
on failure).
This function is based on the C library’s strtod
function
(see strtod
in The GNU C Library
Reference Manual).
Convert number (an inexact) into a string according to the cultural conventions of either locale (a locale object) or the current locale. By default, print as many fractional digits as necessary, up to an upper bound. Optionally, fraction-digits may be bound to an integer specifying the number of fractional digits to be displayed.
Convert amount (an inexact denoting a monetary amount) into a string according to the cultural conventions of either locale (a locale object) or the current locale. If intl? is true, then the international monetary format for the given locale is used (see international and locale monetary formats in The GNU C Library Reference Manual).
Next: Accessing Locale Information, Previous: Character Case Mapping, Up: Internationalization [Contents][Index]