powered by
Round a number, preserving extra 0's.
myround(x, digits = 1)
A vector of character strings.
Number to round.
Number of digits past the decimal point to keep.
Uses base::sprintf() to round a number, keeping extra 0's.
base::sprintf()
base::round(), base::sprintf()
base::round()
myround(51.01, 3) myround(0.199, 2)
Run the code above in your browser using DataLab