"HeuristicPercent" (Interpreter Type)
Percentage expressed in natural language.
Details
- "HeuristicPercent" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "HeuristicPercent" requires connectivity to the Wolfram Cloud.
- When the input is a unitless number, "HeuristicPercent" heuristically decides whether to convert it to a percentage or to infer a percent unit.
Allowed Forms
- All the natural-language numbers allowed by "SemanticNumber" are supported for the quantity magnitude.
- The unit can be expressed in natural language or via abbreviations or symbols.
Restriction Specifications
-
Restricted["HeuristicPercent",{{choices1,…}}] one among choices Restricted["HeuristicPercent",unit] convert to unit Restricted["HeuristicPercent",unit,max] a percentage below Quantity[max,unit] Restricted["HeuristicPercent",unit,{min,max}] a percentage between Quantity[min,unit] and Quantity[max,unit] Restricted["HeuristicPercent",unit,{min,max,s}] a percentage between Quantity[min,unit] and Quantity[max,unit] with step s Restricted["HeuristicPercent",Automatic,Automatic,n] a percentage whose magnitude has n-digit precision
Interpretation
- "HeuristicPercent" yields a Quantity.
Examples
Basic Examples (3)
If no unit is provided, convert to a percent when it seems reasonable:
In other cases, simply infer a percent unit:
Cf. "Percent", which always infers a percent unit:
And "PercentFraction", which always converts to a percentage: