[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: format equivalent of printf "%3.1f", "%03x"
From: |
Keith Wright |
Subject: |
Re: format equivalent of printf "%3.1f", "%03x" |
Date: |
Tue, 16 Oct 2001 01:33:54 -0400 |
> From: Steve Tell <address@hidden>
>
> Does guile's (format) procedure from (ice-9 format) provide a way to
> control the field width and number of decimal places with a ~f conversion,
> by analogy to:
> printf("%4.1f", 1.267) -> " 1.3"
guile> (format #f "like this (~4,1f)" 1.267)
"like this ( 1.3)"
> And also, how do I get leading zeros for hex printing of integers
> as in "04x"?
guile> (format #f "like this (~4,'0x)" 2561)
"like this (0a01)"
> Alternately, has anyone ever implemented a printf procedure for guile (or
> failing that, any scheme, I suppose) that is a full-featured superset of
> C's printf?
Boy are you asking for flamage. Ask again when you are ready for
a quiz on pages 581-608 of Common Lisp: The Language
by Guy L. Steele Jr. (Digital Press)
I bet you are asking for an empty-featured subset before you are done.
But guile.info-14 _is_ missing some details, like how to specify
arguments and, in many cases, what they mean.
--
-- Keith Wright <address@hidden>
Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
--- Food, Shelter, Source code. ---
- format equivalent of printf "%3.1f", "%03x", Steve Tell, 2001/10/15
- Re: format equivalent of printf "%3.1f", "%03x", Per Bothner, 2001/10/16
- Re: format equivalent of printf "%3.1f", "%03x",
Keith Wright <=
- Re: format equivalent of printf "%3.1f", "%03x", Chris Cramer, 2001/10/16
- Re: format equivalent of printf "%3.1f", "%03x", Kyle Cronan, 2001/10/16
- Re: format equivalent of printf "%3.1f", "%03x", Dale P. Smith, 2001/10/16
- Re: format equivalent of printf "%3.1f", "%03x", Steve Tell, 2001/10/17
- Re: format equivalent of printf "%3.1f", "%03x", Martin Grabmueller, 2001/10/18
- Re: format equivalent of printf "%3.1f", "%03x", Thien-Thi Nguyen, 2001/10/26
- Re: format equivalent of printf "%3.1f", "%03x", Keith Wright, 2001/10/16
- Re: format equivalent of printf "%3.1f", "%03x", Keith Wright, 2001/10/16