Round a float, and force a specific number of decimal places

Nash
Wed, 21 Sep 2022 07:22:15 +0000
New to Julia

Rounding a float to two decimal places, say, does not necessarily create a number with two decimal places. For example

round(10.001, digits = 2)

produces 10.0

How can I force a specific number of shown decimal places?

9 posts - 8 participants