val_p_format: Format a P value for reporting

View source: R/utils_format.R

val_p_formatR Documentation

Format a P value for reporting

Description

Format a P value for reporting

Usage

val_p_format(p, digits = 3)

Arguments

p

Numeric P value in the range [0, 1]. NA values are returned as NA_character_. Values >= 1 (or rounding to >= 1) are returned as e.g. ">0.999".

digits

Integer; number of decimal places for reported P values. Default is 3. Note: for p < 0.001, the value is reported in scientific notation with 1 significant figure regardless of digits (e.g., 8E-4).

Value

A character string. Values < 0.001 are formatted in scientific notation with 1 significant figure (e.g., "8E-4"). All other values use fixed-point notation rounded to digits decimal places.


TernTables documentation built on March 26, 2026, 5:09 p.m.