[rrd-users] GPRINT produces float value although input is int

Steve Shipway s.shipway at auckland.ac.nz
Tue May 20 01:52:34 CEST 2014


>  Any way moving on, My graph
> works just fine the only problem that I am facing is when I use
> "GPRINT:".$in_min.": Minimum\:%6.2lf %S", I get a floating value: 195.20
for
> example, although that the value inserted is 195. I tried to round down
the
> value unfortunately with no success. Is there something that I could do to
> make the value appear as int and not as float?

The format printed is specified by the %6.2lf in the GPRINT string.

This means 'a long float, 6 sharacters long with 2 decimal places'.

So, if you use this:

"GPRINT:".$in_min.": Minimum\:%4.0lf %S"

...then you will get a 4-digit number with 0 decimal places.    Thus, 195.2
will be displayed as 195, and so on.  Note that you are getting decimal
values stored, although you updated with integers, due to Data
Normalisation.

Steve

Steve Shipway
s.shipway at auckland.ac.nz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5909 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20140519/8f4f62c0/attachment.bin 


More information about the rrd-users mailing list