# WARNING - Generated by {fusen} from dev/flat_kwb_simulate_inflow.Rmd: do not edit by hand # nolint: line_length_linter.

#' Helper function: get percentile 
#' 
#' This function does the same thing as kwb.utils::get_percentile(),
#' but it is bundled with *ambre* to avoid a hard dependency on the
#' unmaintained package.
#' 
#' @param percent_within_minmax percent of data point within min/max (default: 
#' 0.9 i.e. 90 percent)
#' @references
#'   Sonnenberg H (2024). kwb.utils: General Utility Functions Developed at KWB. R package version 0.15.0
#'   URL: \url{https://github.com/kwb-r/kwb.utils}
#'   (MIT Licence)
#' @noRd
#' @examples
#' get_percentile(0.9)
#' get_percentile(0.95)
get_percentile <- function(percent_within_minmax = 0.9)
{
  qnorm(percent_within_minmax + (1 - percent_within_minmax) / 2)
}
