R/round2.r

Defines functions round2

round2 <- function(x, n) {
  posneg = sign(x)
  z = abs(x)*10^n
  z = z + 0.5
  z = trunc(z)
  z = z/10^n
  return(z*posneg)
}
aescherling/optic-core documentation built on June 15, 2022, 4:56 a.m.