Arc Forumnew | comments | leaders | submitlogin
1 point by eds 5925 days ago | link | parent

After a bit more searching, I finally found a page on printing numbers in the scheme cookbook (http://schemecookbook.org/Cookbook/NumberPrinting), specifically the first example which uses SRFI 48 for some basic formatting support (http://srfi.schemers.org/srfi-48/srfi-48.html). The following to works in Anarki/MzScheme 352.

  arc> ($ (require (lib "48.ss" "srfi")))
  #<void>
  arc> (def format args ($ (format ,@args)))
  #<procedure: format>
  arc> (format "~4,4F" (sqrt 2))
  "1.4142"
Enjoy ;-)