'\" t .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" .TH Num.percent 3 2025-04-30 "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 >> (0.5).percent() = "50%" >> (1./3.).percent(2) = "33.33%" >> (1./3.).percent(2, precision=0.0001) = "33.3333%" >> (1./3.).percent(2, precision=10.) = "30%" .EE