Tiny Yolo2 icon Tiny Yolo2 Real-time TinyYolo object detection for ARC Camera Device: tracks 20 classes, populates camera variables, triggers tracking scripts, 30+ FPS in HD. Try it →
Asked — Edited

Rounding To 3 Places

I think there may be a bug in the rounding to 3 places, it seems that it rounds to 2 places. Here is my little test program that shows it. It may be I'm doing something wrong too.

$55 = 55.18975647547689 $rten = Round($55,0) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,1) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,2) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,3) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,4) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,5) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,6) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,7) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,8) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,9) Print($rten)

$55 = 55.18975647547689 $rten = Round($55,10) Print($rten)


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#1  

55.18975647547689 to 3dp is 55.190 which is 55.19 as the last 0 isn't required and therefore not printed.

Try it with 1.23456789 and you'll see Round($x,3) works.

#2  

Oh I see, I guess I was thinking truncate instead. Duh. Thanks Rich