[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A more sophisticated (format "%f" ...)?
From: |
Pascal J. Bourguignon |
Subject: |
Re: A more sophisticated (format "%f" ...)? |
Date: |
Sun, 14 Jun 2015 23:39:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Marcin Borkowski <mbork@mbork.pl> writes:
> Hi all,
>
> I need to format a float so that I get /at most/ 2 decimal digits after
> point /and/ at most 5 characters altogether. For instance,
>
> 2 -> 2
> 2.34567 -> 2.35
> 123.456 -> 123.5
> 123456 -> XXXXX (since this is too long to fit in 5 characters;
> alternatively, I can more or less safely assume that it's less than 1000)
>
> Is there anything like that in Elisp (or some library), or do I have to
> write it myself?
The later.
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk