show0 {PBSmodelling}R Documentation

Convert Numbers Into Text With Specified Decimal Places

Description

Return character representation of number with specified decimal places.

Usage

show0(x, n, add2int = FALSE) 

Arguments

x Number as scalar or vector
n Number of decimal places to show, include zeroes
add2int If TRUE, add zeroes on the end of integers

Examples

frame()

#do not show decimals on integers
addLabel(0.25,0.75,show0(15.2,4))
addLabel(0.25,0.7,show0(15.1,4))
addLabel(0.25,0.65,show0(15,4))

#show decimals on integers
addLabel(0.25,0.55,show0(15.2,4,TRUE))
addLabel(0.25,0.5,show0(15.1,4,TRUE))
addLabel(0.25,0.45,show0(15,4,TRUE))

[Package PBSmodelling version 0.60 Index]