123456789101112131415161718192021222324252627282930313233343536373839 | '\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Num.percent 3 2026-03-08 "Tomo man-pages"
.SH NAME
Num.percent \- format as a percentage
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Num.percent\ :\ func(n:\ Num,\ precision:\ Num\ =\ 0.01\ ->\ Text)
.fi
.SH DESCRIPTION
Convert a number into a percentage text with a percent sign.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
n Num The number to be converted to a percent. -
precision Num Round the percentage to this precision level. 0.01
.TE
.SH RETURN
A text representation of the number as a percentage with a percent sign.
.SH EXAMPLES
.EX
assert (0.5).percent() == "50%"
assert (1./3.).percent(2) == "34%"
assert (1./3.).percent(precision=0.0001) == "33.3333%"
assert (1./3.).percent(precision=10.) == "30%"
.EE
.SH SEE ALSO
.BR Tomo-Num (3)
|