R/odds.indo2dec.R

#' Convert Indonesian odds to Decimal odds
#'
#' @param x A vector of Indonesian odds
#'
#' @return A vector of Hong Kong odds
#'
#'@export
#'
#' @examples
#' odds.indo2dec(c(1.93,2.05))
odds.indo2dec <- function (x) {
  dec <- x
  dec[] <- NA_real_
  dec[which(x <= -1)] <- -1 / x[which(x <= -1)] + 1
  dec[which(x >= 1)] <- x[which(x >= 1)] + 1
  dec
}

Try the odds.converter package in your browser

Any scripts or data that you put into this service are public.

odds.converter documentation built on May 1, 2019, 8:02 p.m.