The counter was the only variable which needed to be an integer.
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 25 May 2004 22:08:12 +0000 (22:08 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 25 May 2004 22:08:12 +0000 (22:08 +0000)
-- Mike Slifcak

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@274 a5681a0c-68f1-0310-ab6d-d61299d08faa

examples/shared-demo.pl.in

index 8021971..9442196 100755 (executable)
@@ -92,10 +92,10 @@ for (my $t=$START+1;
      $t<$START+$STEP*$RUNS;
      $t+=$STEP+int((rand()-0.5)*7)){
   $counter += int(2500*sin($t/2000)*$STEP);
-  my $data = int(1000+500*sin($t/1000)).":".
-      int(1000+900*sin($t/2330)).":".
-      int(2000*cos($t/1550)).":".
-      int(3220*sin($t/3420)).":$counter";
+  my $data = (1000+500*sin($t/1000)).":".
+      (1000+900*sin($t/2330)).":".
+      (2000*cos($t/1550)).":".
+      (3220*sin($t/3420)).":$counter";
   push(@options, "$t:$data");
   RRDs::update $RRD1, "$t:$data";
   if ($ERROR = RRDs::error) {