Description
This creates a formatted double vector. You can specify the number of digits you want the value
to display after the decimal, and the underlying value will not change. Additionally you can
explicitly set whether scientific notation should be used and if numbers less than 0 should
contain a leading 0.
Usage
number(x = numeric(), digits = 3L, scientific = FALSE, leading_zero = TRUE)is_number(x)
as_number(x)
Value
An S3 vector of class supernova_number
. It should behave like a double, but be
formatted consistently.
Arguments
- x
- digits
The number of digits to display after the decimal point.
- scientific
Whether the number should be represented with scientific notation (e.g. 1e2)
- leading_zero
Whether a leading zero should be used on numbers less than 0 (e.g. .001)