FormatFixedDecimal: Format a Number as a Decimal

View source: R/util.R

FormatFixedDecimalR Documentation

Format a Number as a Decimal

Description

Simple function that can be used as a format function when converting trees to a data.frame

Usage

FormatFixedDecimal(x, digits = 3)

Arguments

x

a numeric scalar or vector

digits

the number of digits to print after the decimal point

Value

A string corresponding to x, suitable for printing

Examples

data(acme)
print(acme, prob = acme$Get("p", format = function(x) FormatFixedDecimal(x, 4)))


gluc/data.tree documentation built on Nov. 16, 2023, 10:49 p.m.