Paste number 91580: format-monetary-value *example*

Paste number 91580: format-monetary-value *example*
Pasted by: adeht
When:9 months, 1 day ago
Share:Tweet this! | http://paste.lisp.org/+1YNW
Channel:#lisp
Paste contents:
Raw Source | XML | Display As
(cffi:defcfun ("strfmon" %strfmon) :int
  (s :pointer)
  (max-size :uint)
  (format :string)
  &rest)

(defmacro format-monetary-value (format-string &rest args)
  `(cffi:with-foreign-pointer-as-string (output 128)
     (%strfmon output 128 ,format-string
               ,@(loop for arg in args collect :double collect `(float ,arg 0.0d0)))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.