[rrd-users] Re: difference between %le and $lf in PRINT functions

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Mon May 20 03:00:32 MEST 2002


Adam Clark wrote:

> I'm having difficulty in aligning columns using print and GPRINT.  I want to
> align up decimal points
> I have formated the string as:
> GPRINT:c_host:MIN:"%3.3lf %sS"

%3.3lf can't be right.  When you R that FM (of printf that is) you find
that you ask for a total of 3 positions, including a decimal point and
3 positions after the point.

So, ".3" is already 4 positions.

You are using "%s", which is good as this makes sure the number of positions
before the decimal point will not exceed 3.

So, what you need is 3 before the DP, 3 after the DP, the DP itself
and this makes a total of 7.  Try "%7.3lf %sS"

HTH
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list