Ask Your Question
1

puttext N decimal places

asked 2016-12-07 12:27:31 -0600

Nbb gravatar image

how do i tell puttext that i want only 2 decimal or 3 decimal places ? it always gives me 6 decimal places like 22.210000

edit retag flag offensive close merge delete

Comments

what programming language do you use ?

megab gravatar imagemegab ( 2016-12-07 13:22:40 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-12-07 13:40:52 -0600

berak gravatar image

cv::putText on it's own does not do any formatting.

imho, you want something like this:

cv::putText(img, cv::format("i am: %3.3f", some_float_number), ...)
edit flag offensive delete link more

Comments

wow that function is great !

Nbb gravatar imageNbb ( 2016-12-07 22:16:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-07 12:27:31 -0600

Seen: 1,835 times

Last updated: Dec 07 '16