help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A more sophisticated (format "%f" ...)?


From: Marcin Borkowski
Subject: A more sophisticated (format "%f" ...)?
Date: Sun, 14 Jun 2015 21:10:12 +0200

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?

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

[Prev in Thread] Current Thread [Next in Thread]