top of page

62. "All (100%)"

Description

Format a percentage as "all (100%)", "half (50%)", "five percent (5%)", etc.

Code

""
IF Percent-n = 100
"all (100%)"
ELSE IF Percent-n = 75
"three-fourths (75%)"
ELSE IF TRUNCATE( Percent-n, 0 ) = 66
"two-thirds (66%)"
ELSE IF Percent-n = 50
"one-half (50%)"
ELSE IF Percent-n = 25
"one-fourth (25%)"
ELSE IF TRUNCATE( Percent-n, 0 ) = 33
"one-third (33%)"
ELSE
"«Percent-n:nine» percent («Percent-n»%)"
END IF

Explanation

This computation is a percentage formatter. It will spell out the common percentages in their fractional equivalents:

One-fourth (25%)
One-third (33%)
One-half (50%)
Two-thirds (66%)
Three-fourths (75%)
All (100%)
All other percentages are spelled out: forty percent (40%).

See also, Computation 51: Format a Number as "nine point seven five", 52: Format a Fraction as "four and one half", #0116: (Even) Smarter Fraction Formatting, #0150: Decimal Formatter.

bottom of page