From 1467350512bd1db28875ebfe48d7e8e36f121e48 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:11:36 +0000 Subject: [PATCH 1/5] fix(formula): percent and currency formulas total and chip as their return type; lint names all six return types Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude --- packages/lint/src/rule-explanations.test.ts | 14 ++++ packages/lint/src/rule-explanations.ts | 5 +- .../plugin-detail/src/HeaderHighlight.tsx | 27 +++++-- ...Highlight.formulaReturnType-35734.test.tsx | 77 +++++++++++++++++++ .../plugin-grid/src/useColumnSummary.test.tsx | 43 +++++++++++ .../plugin-grid/src/useColumnSummary.ts | 44 +++++++++-- 6 files changed, 198 insertions(+), 12 deletions(-) create mode 100644 ui/packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx diff --git a/packages/lint/src/rule-explanations.test.ts b/packages/lint/src/rule-explanations.test.ts index 00c2c91de19..a5ee90b7eca 100644 --- a/packages/lint/src/rule-explanations.test.ts +++ b/packages/lint/src/rule-explanations.test.ts @@ -16,11 +16,13 @@ import { FUNCTIONAL_COMPLETENESS_RULES, MAX_CUSTOMIZATION_BASE_NAMESPACE_LENGTH, } from '@objectstack/spec/kernel'; +import { FieldSchema } from '@objectstack/spec/data'; import * as indexBarrel from './index.js'; import { RULE_EXPLANATIONS, explainRule } from './rule-explanations.js'; import { CARRIER_ROOTS, CONSUMER_ROOTS, FIELD_NO_CONSUMERS } from './validate-field-consumers.js'; import { NAMESPACE_NO_CUSTOMIZATION_PAIR } from './validate-customization-namespace.js'; +import { DIMENSION_VIRTUAL_FIELD_REFUSED } from './validate-dataset-measure-aggregates.js'; const HERE = dirname(fileURLToPath(import.meta.url)); @@ -112,6 +114,18 @@ describe('rule explanations (#22161)', () => { expect(text).toContain(`to ${max} characters or fewer`); }); + // The module imports nothing, so the formula return types the stored copy + // may take are written out in the text; held here to the spec's own enum, + // so a return type the spec adds cannot be missing from the prescription. + it('the dimension-virtual-field-refused prescription names every formula return type', () => { + const text = explainRule(DIMENSION_VIRTUAL_FIELD_REFUSED)!.paragraphs.join('\n'); + const listed = /of the formula's `returnType` \(([^)]*)\)/.exec(text)?.[1]; + expect(listed).toBeDefined(); + const named = [...listed!.matchAll(/`([a-z_]+)`/g)].map((m) => m[1]).sort(); + const members = (FieldSchema.shape.returnType.unwrap().options as readonly string[]).slice().sort(); + expect(named).toEqual(members); + }); + it('explainRule is an exact-id lookup: no prefix, case or prototype match', () => { expect(explainRule(FIELD_NO_CONSUMERS)?.rule).toBe(FIELD_NO_CONSUMERS); expect(explainRule('field-no-consumer')).toBeUndefined(); diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index 04851ba3e9d..b938a90257a 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -2734,8 +2734,9 @@ const DIMENSION_VIRTUAL_FIELD_REFUSED_EXPLANATION: RuleExplanation = { 'Before those refusals the group key reached the driver as a column that does not exist, or an ' + 'engine that aggregates in memory put every row into one null group while the answer looked served.', 'Denormalise the value: make it a stored field of its own on the object, of the formula\'s ' + - '`returnType` (`number`, `text`, `boolean`, `date` or `currency`) and carrying the same `expression`, ' + - 'which the engine computes and stores on every write, and point the dimension at that stored field. ' + + '`returnType` (`number`, `text`, `boolean`, `date`, `currency` or `percent`) and carrying the same ' + + '`expression`, which the engine computes and stores on every write, and point the dimension at that ' + + 'stored field. ' + 'This rule makes the same ' + 'refusal where the author is standing. A dotted path is judged on the leaf\'s own declaration.', ANALYTICS_MEMBER_WALK, diff --git a/ui/packages/plugin-detail/src/HeaderHighlight.tsx b/ui/packages/plugin-detail/src/HeaderHighlight.tsx index 6f3c4bbb8e3..143764604a9 100644 --- a/ui/packages/plugin-detail/src/HeaderHighlight.tsx +++ b/ui/packages/plugin-detail/src/HeaderHighlight.tsx @@ -35,6 +35,18 @@ import { hasCellValue } from './emptiness'; import { useDefaultRecordPage } from './defaultRecordPage'; import { dropFieldPredicateHidden, lazyPredicateRecord } from './fieldPredicateVisibility'; +/** + * The field type a `formula` reads as, when its declared `returnType` is one + * the spec reads AS a field type: `currency` ("an amount of money … as a + * currency field declares it") and `percent` ("read and displayed as a + * `percent` field reads its stored value"). `undefined` for any other field + * or return type. + */ +function formulaReadsAsFieldType(type: string | undefined, returnType: unknown): 'currency' | 'percent' | undefined { + if (type !== 'formula') return undefined; + return returnType === 'currency' || returnType === 'percent' ? returnType : undefined; +} + export interface HeaderHighlightProps { fields: HighlightField[]; data?: any; @@ -256,12 +268,17 @@ export const HeaderHighlight: React.FC = ({ // coerceToSafeValue() so even object/array data is safe (no error #310). const CellRenderer = getCellRenderer(drawnType); + // A `formula` declaring a return type the spec reads AS a field + // type (`currency`, `percent`) is a figure of that type, drawn by + // that type's cell, so it is a KPI chip as that field is. Every + // other formula keeps its own type here. + const valueType = formulaReadsAsFieldType(resolvedType, objectDefField?.returnType) ?? resolvedType; const isKpi = - resolvedType === 'number' || - resolvedType === 'integer' || - resolvedType === 'currency' || - resolvedType === 'percent' || - resolvedType === 'decimal'; + valueType === 'number' || + valueType === 'integer' || + valueType === 'currency' || + valueType === 'percent' || + valueType === 'decimal'; // Two independent reasons a chip needs the wide basis, kept // separate because only one of them is a shared table: // 1. long-text DISPLAY types, whose value simply does not fit a diff --git a/ui/packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx b/ui/packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx new file mode 100644 index 00000000000..8c12534c205 --- /dev/null +++ b/ui/packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx @@ -0,0 +1,77 @@ +/** + * ObjectUI + * Copyright (c) 2024-present ObjectStack Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * A `formula` whose declared `returnType` the spec reads AS a field type + * (`percent`, `currency`) is a KPI chip on the highlights strip, as a field of + * that type is: its value carries the strip's figure typography. A formula of + * any other return type keeps the face it had (CONTROL: `number`). + */ +import { describe, it, expect, afterEach } from 'vitest'; +import { render, screen, cleanup } from '@testing-library/react'; +import * as React from 'react'; +import { HeaderHighlight } from '../HeaderHighlight'; + +afterEach(cleanup); + +const objectSchema = { + fields: { + win_rate: { type: 'percent', label: 'Win Rate' }, + margin_pct: { type: 'formula', label: 'Margin', returnType: 'percent', expression: 'record.profit / record.revenue' }, + net_amount: { type: 'formula', label: 'Net', returnType: 'currency', expression: 'record.revenue - record.cost' }, + units_left: { type: 'formula', label: 'Units Left', returnType: 'number', expression: 'record.stock - record.sold' }, + }, +}; + +function renderStrip() { + render( + , + ); +} + +/** The value span of the chip captioned `label`. */ +const valueOf = (label: string) => { + const span = (screen.getByText(label).closest('div.group') as HTMLElement).querySelector('span.truncate'); + expect(span, `a value span under "${label}"`).not.toBeNull(); + return span as HTMLElement; +}; + +describe('the highlights strip reads a formula by its declared returnType (objectstack#35734)', () => { + it('a percent field is a KPI chip (the reference)', () => { + renderStrip(); + expect(valueOf('Win Rate').className).toMatch(/\btabular-nums\b/); + }); + + it('a percent-returning formula is a KPI chip, as a percent field is', () => { + renderStrip(); + expect(valueOf('Margin').className).toMatch(/\btabular-nums\b/); + expect(valueOf('Margin').className).toBe(valueOf('Win Rate').className); + expect(valueOf('Margin').textContent).toContain('25%'); + }); + + it('a currency-returning formula is a KPI chip too', () => { + renderStrip(); + expect(valueOf('Net').className).toMatch(/\btabular-nums\b/); + }); + + it('CONTROL: a number-returning formula keeps the face it had', () => { + renderStrip(); + expect(valueOf('Units Left').className).not.toMatch(/\btabular-nums\b/); + }); +}); diff --git a/ui/packages/plugin-grid/src/useColumnSummary.test.tsx b/ui/packages/plugin-grid/src/useColumnSummary.test.tsx index 414d530704a..fe262e4fb23 100644 --- a/ui/packages/plugin-grid/src/useColumnSummary.test.tsx +++ b/ui/packages/plugin-grid/src/useColumnSummary.test.tsx @@ -148,3 +148,46 @@ describe('useColumnSummary formatting stays with the numeric family', () => { expect(result.current.summaries.get('amount')?.label).toMatch(/\$|US\$/); }); }); + +/** + * A `formula` column's footer reads its declared `returnType` when the spec + * reads that return type AS a field type (`percent`, `currency`), so the total + * reads in the unit of the cells above it. Every other formula keeps the plain + * arm (CONTROL: `number`). + */ +describe('useColumnSummary reads a formula by its declared returnType (objectstack#35734)', () => { + const RATES = [{ rate: 0.25 }, { rate: 0.5 }]; + const sumOf = (meta: Record) => + renderHook(() => useColumnSummary([{ field: 'rate', summary: 'sum' }] as any[], RATES, meta), { + wrapper: wrapper('USD'), + }).result.current.summaries.get('rate')?.label; + + it('a percent-returning formula totals as a percentage, as a percent field does', () => { + const formula = sumOf({ rate: { type: 'formula', returnType: 'percent' } }); + expect(formula).toBe('Sum: 75%'); + expect(formula).toBe(sumOf({ rate: { type: 'percent' } })); + }); + + it('a percent-returning formula keeps its declared width and storage', () => { + expect(sumOf({ rate: { type: 'formula', returnType: 'percent', scale: 1 } })).toBe('Sum: 75.0%'); + // `max` above 1 declares percentage points: 0.75 is under one percent. + expect(sumOf({ rate: { type: 'formula', returnType: 'percent', max: 100 } })).toBe( + sumOf({ rate: { type: 'percent', max: 100 } }), + ); + }); + + it('a currency-returning formula totals as money in its declared currency', () => { + const { result } = renderHook( + () => useColumnSummary([{ field: 'net', summary: 'sum' }] as any[], [{ net: 1000 }, { net: 234 }], { + net: { type: 'formula', returnType: 'currency', currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'USD' } }, + }), + { wrapper: wrapper('CNY') }, + ); + expect(result.current.summaries.get('net')?.label).toBe('Sum: $1,234.00'); + }); + + it('CONTROL: a number-returning formula totals as it did, a plain number', () => { + expect(sumOf({ rate: { type: 'formula', returnType: 'number' } })).toBe('Sum: 0.75'); + expect(sumOf({ rate: { type: 'formula', returnType: 'number' } })).toBe(sumOf({ rate: { type: 'formula' } })); + }); +}); diff --git a/ui/packages/plugin-grid/src/useColumnSummary.ts b/ui/packages/plugin-grid/src/useColumnSummary.ts index 7803efa5aef..0f66f24290d 100644 --- a/ui/packages/plugin-grid/src/useColumnSummary.ts +++ b/ui/packages/plugin-grid/src/useColumnSummary.ts @@ -376,11 +376,31 @@ function summaryValueType(column: { currencyConfig?: unknown; scale?: number | n return resolveFieldScale(column) === undefined ? 'summary' : 'number'; } +/** + * The return types the spec reads AS a field type: `currency` is "an amount of + * money … as a currency field declares it", and `percent` is "read and + * displayed as a `percent` field reads its stored value". The list cell draws + * them through the currency and percent cells (`FormulaCellRenderer`). + */ +const FIELD_TYPED_FORMULA_RETURNS: ReadonlySet = new Set(['currency', 'percent']); + +/** + * The arm a `formula` column's total is formatted by: its declared + * `returnType` when the spec reads that return type as a field type, so a + * percent-returning formula's total reads as a percentage under cells that + * read as percentages, and a currency-returning one's as money. Any other + * formula keeps the plain arm it always took. + */ +function formulaValueType(column: { returnType?: unknown }): string { + const declared = column.returnType; + return typeof declared === 'string' && FIELD_TYPED_FORMULA_RETURNS.has(declared) ? declared : 'formula'; +} + function formatSummaryLabel( type: string, value: number | null, t: SummaryTranslate, - column: { type?: string; currency?: string; defaultCurrency?: string; currencyConfig?: { defaultCurrency?: string }; precision?: number | null; scale?: number | null; max?: number } | undefined, + column: { type?: string; returnType?: string; currency?: string; defaultCurrency?: string; currencyConfig?: { defaultCurrency?: string }; precision?: number | null; scale?: number | null; max?: number } | undefined, tenantDefault: string | undefined, // The BCP-47 tag from `useDisplayLocale()` — tenant locale, then UI // language, then a concrete `'en'`, never `undefined`. @@ -419,7 +439,9 @@ function formatSummaryLabel( return join(value.toLocaleString(displayLocale)); } - const colType = column?.type === 'summary' ? summaryValueType(column) : column?.type; + const colType = column?.type === 'summary' + ? summaryValueType(column) + : column?.type === 'formula' ? formulaValueType(column) : column?.type; let formatted: string; if (colType === 'currency') { // objectui#10221 — a currency's decimal places are the currency's, not a @@ -500,8 +522,17 @@ function formatSummaryLabel( // over the field's `max`), the answer the cell above reads. The shared // scaling used to guess from the magnitude, so a fraction-stored column // summing to `1` (100%) read `Sum: 1%` under cells reading the same rows. - const decimals = resolveFieldScale(column); - formatted = formatPercent(value, percentCellScale(column), decimals, displayLocale); + // + // A percent-returning `formula` reaches this arm too, and is read as the + // `percent` field it reads like, as the list cell hands it on + // (`FormulaCellRenderer`): `resolveFieldScale` keys its absent-`scale` row + // on the type, and a formula's own type has none, so an undeclared width + // would fall to `formatPercent`'s private default while the cell read `0`. + // Every column that reaches this arm is a percent, so the face below + // changes the type of the formula alone. + const percentFace = { ...column, type: 'percent' }; + const decimals = resolveFieldScale(percentFace); + formatted = formatPercent(value, percentCellScale(percentFace), decimals, displayLocale); } else if (colType === 'number') { // objectstack#19628, ruled A′ and carried to this footer by objectui#9843: // a `number` column's width is `resolveFieldScale`'s answer too, and for a @@ -531,7 +562,7 @@ function formatSummaryLabel( } /** The `objectSchema.fields` slice the footer formats with. */ -type SummaryFieldMetadata = Record; +type SummaryFieldMetadata = Record; /** * Which rows the footer's figures describe (objectui#12081 item 3). @@ -724,6 +755,9 @@ export function useScopedColumnSummary( // objectui#11475 — a percent field's declared `max`, its STORAGE // statement (`percentScaleOf`: a fraction unless `max` is above 1). max: meta?.max, + // A `formula`'s declared value type: a `percent` or `currency` one is + // totalled in that type's arm (`formulaValueType`). + returnType: meta?.returnType, }; // The widest decimal count among the numeric values this aggregation From c5a39407f887f6d3ce1744d6546ac4411de63ada Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:15:02 +0000 Subject: [PATCH 2/5] fix(grid): state what the percent face resolves, without a claim about the default Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude --- ui/packages/plugin-grid/src/useColumnSummary.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/packages/plugin-grid/src/useColumnSummary.ts b/ui/packages/plugin-grid/src/useColumnSummary.ts index 0f66f24290d..ba8b5b53f0f 100644 --- a/ui/packages/plugin-grid/src/useColumnSummary.ts +++ b/ui/packages/plugin-grid/src/useColumnSummary.ts @@ -527,9 +527,9 @@ function formatSummaryLabel( // `percent` field it reads like, as the list cell hands it on // (`FormulaCellRenderer`): `resolveFieldScale` keys its absent-`scale` row // on the type, and a formula's own type has none, so an undeclared width - // would fall to `formatPercent`'s private default while the cell read `0`. - // Every column that reaches this arm is a percent, so the face below - // changes the type of the formula alone. + // takes the platform's percent width rather than `formatPercent`'s own + // parameter default. Every column that reaches this arm is a percent, so + // the face below changes the type of the formula alone. const percentFace = { ...column, type: 'percent' }; const decimals = resolveFieldScale(percentFace); formatted = formatPercent(value, percentCellScale(percentFace), decimals, displayLocale); From 6dcfc427722fd627e540b2adfcce3cb7c1fd47a8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:15:16 +0000 Subject: [PATCH 3/5] chore(changeset): percent and currency formula footer and chip, lint return-type list Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude --- .changeset/35734-percent-formula-return.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/35734-percent-formula-return.md diff --git a/.changeset/35734-percent-formula-return.md b/.changeset/35734-percent-formula-return.md new file mode 100644 index 00000000000..4b59bfb0d85 --- /dev/null +++ b/.changeset/35734-percent-formula-return.md @@ -0,0 +1,14 @@ +--- +'@objectstack/lint': patch +'@object-ui/plugin-grid': patch +'@object-ui/plugin-detail': patch +--- + +fix: a `percent` or `currency` formula totals and chips as its return type; the lint prescription names all six return types + +Clause-②: no +Metadata-protocol: none + +A `formula` field whose `returnType` is `percent` drew percentages in its list cells while the grid footer summed it as a plain number (`Sum: 0.75` under cells reading `25%` and `50%`), and the record header strip drew it without the figure typography a `percent` field's chip has. The footer and the strip now read a formula's declared `returnType` before they pick an arm, for the two return types the spec reads as a field type: a `percent` formula totals as a percentage (`Sum: 75%`) at its declared `scale` and `max`, as a `percent` field does, and a `currency` formula totals as money in the currency its `currencyConfig` declares, as a `currency` field does. Both are KPI chips on the header strip. A formula of any other return type totals and chips as before. + +`os explain dimension-virtual-field-refused` told the author to make a stored copy "of the formula's `returnType` (`number`, `text`, `boolean`, `date` or `currency`)", which named no type for a `percent` formula. It now lists all six, and a test holds the list to the spec's own `returnType` enum. From e62abfdbd851fc2269af488d29e1015c256077b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:34:53 +0000 Subject: [PATCH 4/5] fix(grid): keep the percent footer's storage call on the column, as the storage ledger names it Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude --- ui/packages/plugin-grid/src/useColumnSummary.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/packages/plugin-grid/src/useColumnSummary.ts b/ui/packages/plugin-grid/src/useColumnSummary.ts index ba8b5b53f0f..33553f2c370 100644 --- a/ui/packages/plugin-grid/src/useColumnSummary.ts +++ b/ui/packages/plugin-grid/src/useColumnSummary.ts @@ -529,10 +529,11 @@ function formatSummaryLabel( // on the type, and a formula's own type has none, so an undeclared width // takes the platform's percent width rather than `formatPercent`'s own // parameter default. Every column that reaches this arm is a percent, so - // the face below changes the type of the formula alone. - const percentFace = { ...column, type: 'percent' }; - const decimals = resolveFieldScale(percentFace); - formatted = formatPercent(value, percentCellScale(percentFace), decimals, displayLocale); + // the type below changes for the formula alone. Its storage is read off + // the column as is: `percentCellScale` reads the declared `max`, and the + // formula declares it as a percent field does. + const decimals = resolveFieldScale({ ...column, type: 'percent' }); + formatted = formatPercent(value, percentCellScale(column), decimals, displayLocale); } else if (colType === 'number') { // objectstack#19628, ruled A′ and carried to this footer by objectui#9843: // a `number` column's width is `resolveFieldScale`'s answer too, and for a From 117c84536ff03dc0969ddfa37e5b7c63b589f11e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 08:30:03 +0000 Subject: [PATCH 5/5] docs(changeset): a formula column summary stays refused at authoring; the footer leg formats a browser-only footer Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude --- .changeset/35734-percent-formula-return.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.changeset/35734-percent-formula-return.md b/.changeset/35734-percent-formula-return.md index 4b59bfb0d85..ba88fa172d1 100644 --- a/.changeset/35734-percent-formula-return.md +++ b/.changeset/35734-percent-formula-return.md @@ -4,11 +4,13 @@ '@object-ui/plugin-detail': patch --- -fix: a `percent` or `currency` formula totals and chips as its return type; the lint prescription names all six return types +fix: a `percent` or `currency` formula is a KPI chip on the record header; the lint prescription names all six return types Clause-②: no Metadata-protocol: none -A `formula` field whose `returnType` is `percent` drew percentages in its list cells while the grid footer summed it as a plain number (`Sum: 0.75` under cells reading `25%` and `50%`), and the record header strip drew it without the figure typography a `percent` field's chip has. The footer and the strip now read a formula's declared `returnType` before they pick an arm, for the two return types the spec reads as a field type: a `percent` formula totals as a percentage (`Sum: 75%`) at its declared `scale` and `max`, as a `percent` field does, and a `currency` formula totals as money in the currency its `currencyConfig` declares, as a `currency` field does. Both are KPI chips on the header strip. A formula of any other return type totals and chips as before. +A `formula` field whose `returnType` is `percent` drew percentages in its list cells, and the record header strip drew it without the figure typography a `percent` field's chip has. The strip now reads a formula's declared `returnType` before it picks its face, for the two return types the spec reads as a field type, `percent` and `currency`. Both are KPI chips on the header strip. A formula of any other return type chips as before. + +The grid's footer formatting reads the same two return types, so a browser-computed footer over a `percent` formula reads `Sum: 75%` rather than `Sum: 0.75`, and over a `currency` formula reads as money. That is not a supported authoring shape: a `sum`, `avg`, `min` or `max` column summary over a `formula` field is refused at authoring by `list-view-summary-field-type-refused`, whatever its `returnType`, because a formula is computed on read and stored in no column, and the whole-set footer query answers `400 INVALID_FIELD`. The formatting reaches only an ungrouped, one-page footer the browser computes over a declaration `os validate` refuses. To total a formula's value, make it a stored field of its own, of the formula's `returnType` and carrying the same `expression`, which the engine computes and stores on every write, and summarise that field. `os explain dimension-virtual-field-refused` told the author to make a stored copy "of the formula's `returnType` (`number`, `text`, `boolean`, `date` or `currency`)", which named no type for a `percent` formula. It now lists all six, and a test holds the list to the spec's own `returnType` enum.