The numformat-old package contains some old and highly-questionable Scheme number-formatting code, which happens to still be used. Do not use this for anything important. A better modern Racket implementation of this functionality should be done.
→ (-> number? (output-port? (current-output-port)) void?) specs : (listof (cons/c symbol? any/c))
> (define display-dollars-and-cents (make-number-displayer '((sign parens) (prefix "$") (pad-whole-char #f) (pad-whole-length #f) (whole-spacers-char #\,) (whole-spacers-interval 3) (decimal-point #\.) (max-fractional-length 2) (pad-fractional-char #\0) (pad-fractional-length 2) (suffix #f))))
> (display-dollars-and-cents 69.1)
> (display-dollars-and-cents -987654321.6969697)
> (define x -987654321.6969697)
> (display-number/us-style x)
> (display-number/european-style x)
-987 654 321,6969697
- Version 2:0 —
Moving from PLaneT to new package system.
Renaming package from numformat to numformat-old, to avoid grabbing better package name for this old code.
Changed “European-style” to use spaces instead of apostrophes.
- Version 1:0 —
Initial release of some old, buggy code.
Copyright 2011, 2016 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.