[cl-l10n-devel] Some modification requested

Andrea Chiumenti kiuma72 at gmail.com
Tue Mar 4 16:27:41 UTC 2008


Hello,
I'm new here nice library

I'd like to point out some possible implementations:

the possibility to not specify the decimal digits:

(defun format-number (stream arg no-dp no-ts
                             &optional (locale (current-locale)))
  (let ((locale (locale locale))
        (float-part (float-part (coerce (abs arg) 'double-float))))
    (cl:format stream
               (getf (printers locale)
                     (if no-ts :number-no-ts :number-ts))
               (get-sign arg locale)
               (truncate (abs arg))
               (unless (and (string= "" float-part) no-dp)
                 (list (locale-decimal-point locale)
               (if *float-digits*
               (fix-float-string float-part *float-digits*)
               float-part))))
    (values)))


this will permit the following:

CL-L10N>  (let ((cl-l10n:*locale* "it_CH")(cl-l10n:*float-digits* nil))
(format nil "~:/cl-l10n:format-number/" (coerce
1/100000000000000000000000000000000 'double-float)))
"0,00000000000000000000000000000001"

Secondly it_IT is missing:
a solution should be if "it_XX" is not found use the locale "it"

and if "xx_XX" and "xx" doesn't exist use the "en" locale.

Let me know,
cheers

kiuma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-l10n-devel/attachments/20080304/e522723b/attachment.html>


More information about the cl-l10n-devel mailing list