Learn R Programming

ribiosUtils (version 1.7.7)

percentage: Print a decimal number in procent format

Description

Print a decimal number in procent format

Usage

percentage(x, fmt = "1.1")

Value

Character string

Arguments

x

a decimal number, usually between -1 and 1

fmt

format string, '1.1' means a digit before and after the decimal point will be printed

Examples

Run this code

percentage(c(0,0.1,0.25,1))
percentage(c(0,0.1,0.25,1), fmt="1.4")
percentage(c(0,-0.1,0.25,-1), fmt="+1.1")


Run the code above in your browser using DataLab