From 8474ff4db7ba73a3961d718446a76c945363681f Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:37:20 -0400 Subject: [PATCH] Special message if min = max --- R/standalone-types-check.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/standalone-types-check.R b/R/standalone-types-check.R index 90a889f1b..94302bf3c 100644 --- a/R/standalone-types-check.R +++ b/R/standalone-types-check.R @@ -8,6 +8,8 @@ # --- # # ## Changelog +# 2024-06-28: +# - Improved error messages of number checkers (@olivroy) # # 2023-03-13: # - Improved error messages of number checkers (@teunbrand) @@ -258,7 +260,11 @@ check_number_whole <- function(x, max <- max %||% Inf if (min > -Inf && max < Inf) { - what <- sprintf("%s between %s and %s", what, min, max) + if (min == max) { + what <- sprintf("%s equal to %s", what, min) + } else { + what <- sprintf("%s between %s and %s", what, min, max) + } } else if (x < min) { what <- sprintf("%s larger than or equal to %s", what, min) } else if (x > max) {