roundn Function

public pure elemental function roundn(x, n) result(r)

Round x to n digits.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x

Number to be rounded.

integer(kind=int32), intent(in) :: n

Number of digits.s

Return Value real(kind=dp)

Rounded number