1234567891011121314151617181920212223242526272829303132333435363738 | '\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH Num.percent 3 2026-08-27 "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\ =\ 1%\ ->\ Text)
.fi
.SH DESCRIPTION
A number as a percentage, rounded to the given precision.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
n Num The number to format. -
precision Num Round the percentage to this precision. 1%
.TE
.SH RETURN
The percentage, with a percent sign.
.SH EXAMPLES
.EX
assert (0.5).percent() == "50%"
assert (1./3.).percent() == "33%"
assert (1./3.).percent(0.01%) == "33.33%"
.EE
.SH SEE ALSO
.BR Tomo-Num (3)
|