round0: Round a number and make it show zeros

round0R Documentation

Round a number and make it show zeros

Description

Rounds values in its first argument to the specified number of decimal places, returning character, ensuring first decimal digits are showed even when they are zeros.

Usage

round0(x, digits = 0)

Arguments

x

A numeric vector.

digits

Integer indicating the number of decimal places. Defaults to 0.

Value

A character vector.

References

https://stackoverflow.com/questions/42105336/how-to-round-a-number-and-make-it-show-zeros

See Also

round

Examples

a = 14.0034
round0(a,2)

b = 10
round0(b,1)


tidyfst documentation built on Sept. 16, 2024, 9:06 a.m.