An integer value which determines the number of digits after the decimal point when all said digits are zero. This variable only has an effect when printing numbers as monetary printing gets this value from the locale.
Loads the locale designated by the locale-designator name which is expected to be found in
*locale-path*
. If use-cache isnil
the locale will be forcibly reloaded from path otherwise the cached locale will be returned. If the locale cannot be found and errorp is not nil an error of typelocale-error
will be signalled.
Returns the value of key in cagetory category-name found in the
locale
locale.
Load all locales found in pathname path.
Prints number using locale locale. If no-ts is not nil no thousand seperators will be used when printing number. If no-dp is not nil the decimal seperator will be suppressed if number is not an integer.
format-number is intended to be used as an argument to the ~/ / format directive. Example (assuming *locale* is en_ZA)
(format t "~:/cl-l10n:format-number/" 1002932) prints `1,002,932`
Prints value as a monetary value using locale locale. If no-ts is not nil no thousand seperators will be used when printing number. If use-int-sym is not nil
locale-int-curr-symbol
will be used instead of the defaultlocale-currency-symbol
Prints value as a monetary value using locale locale. format-money is intended to be used as the function to the ~/ / format directive Examples.
(format t "~/cl-l10n:format-money/" 188232.2322) prints `R188,232.23` ;; and (format t "~:/cl-l10n:format-money/" 188232.2322) prints `ZAR 188,232.23`
Prints the
universal-time
ut as a locale specific time to stream. Equivalent to(format-time stream ut show-date show-time locale fmt time-zone)
.
Prints the
universal-time
ut as a locale specific time to stream. The format of the time printed is controlled by show-time and show-date.
show-time and show-date are not nil
locale-d-t-fmt
show-time and show-date are nil
locale-t-fmt-ampm
orlocale-t-fmt
iflocale-t-fmt-ampm
has no apparent value.show-time is not nil and show-date is nil
- locale-t-fmt
show-date is not nil and show-time is nil
- locale-d-fmt
If fmt is not nil then show-date and show-time are ignored and fmt is used as the format control string. See the Notes Section for the defined control characters which can be used.
Examples (assuming *locale* is “en_ZA” and a CL -2 Time Zone)
(format t "~:/cl-l10n:format-time/" 3192624000) prints `03/03/01' (format t "~@/cl-l10n:format-time/" 3192624000) prints `18:00:00' (format t "~:@/cl-l10n:format-time/" 3192624000) prints `Sat 03 Mar 2001 18:00:00 +0200' (format t "~v,v/cl-l10n:format-time/" "fr_FR" "%A" 3192624000) prints `samedi' (format t "~,v/cl-l10n:format-time/" "%A" 3192624000) prints `Saturday' ; The Time Zone can be overriden with an extra v argument (format t "~v,v,v/cl-l10n:format-time/" "en_ZA" "%A" -8 3192624000) print `Sunday'
Format is an unexported symbol in the cl-l10n package. It's use is to make formatting of dates, times, numbers and monetary values simpler. Shadow importing
cl-l10::format
into your package gives you a few new format directives. The new directives are ~U : Time and Date (universal-time), ~N : Numbers and ~M : Monetary values. All other format directives are unchanged and work as normal. These new directives are drop in replacements for the ~/cl-l10n:format-?/ calls.;; These examples assume an en_ZA locale and a CL -2 Time Zone (in-package :cl-user) (shadowing-import 'cl-l10n::format) (format t "~:U" 3192624000) prints `03/03/2001' (format t "~,vU" "%A" 3192624000) prints `Saturday' (format t "~:N" 3192624000) prints `3,192,624,000' (format t "~:M" 3192624000) prints `ZAR 3,192,624,000.00`
Formatter is another unexported symbol in the cl-l10n package Shadow importing formatter gives support for the new format control directives.
Parses the string num-string into a number using locale.
Tries very hard to make sense out of the argument time-string using locale and returns a single integer representing the universal time if successful. If not, it returns nil. If the :error-on-mismatch keyword is true, parse-time will signal an error instead of returning nil. Default values for each part of the time/date can be specified by the appropriate :default- keyword. These keywords can be given a numeric value or the keyword :current to set them to the current value. The default-default values are 00:00:00 on the current date, current time-zone.
Example, what date does the string “02/03/05” specify? parse-time will use the current locale or the locale-designator passed to it to determine the correct format for dates. In America (en_US) this date is the 3rd of February 2005, with an South African English (en_ZA) locale this date is the 2nd of March 2005 and with a Swedish locale (sv_SE) it's the 5th of March 2002.
Note. This is not my work but was done by Jim Healy and is a part of the CMUCL project, which has been modified to handle differt locales.
Class Precedence:
standard-object
The class representing a loaded category within a locale.