Found while adding duly_duty_health.on_time_rate in #52. The rate ships as a bare fraction (format: '0.00' → 0.94) because every percent spelling is either inert or wrong at the one value that matters most.
Measured, in the browser, against the demo's 0.94
measure format | tile renders |
|---|
| (absent) | 0.94 |
'percent' | 1 |
'0.00' | 0.94 — what ships |
'percent' is the obvious spelling and it is silently wrong. The console treats format as a numeral pattern, not a keyword (@object-ui/core, utils/dataset-format.ts#formatMeasure): decimals come from format.split('.')[1]?.match(/0/g)?.length ?? 0, and percent mode turns on only for a literal %. So 'percent' means "zero decimals, not a percent", and 0.94 rounds to 1.
Why '0.0%' is not the answer either
Percent mode scales by a heuristic, because a measure — unlike a field — has no declared percentScale to hand:
exportfunctionpercentDisplayValue(value: number): number{returnvalue>-1&&value<1 ? value*100 : value;}A ratio of exactly 1 is outside that window, so a 100%-on-time period renders as 1.0%. The function's own docblock records the same defect for fields (objectui#3136), which was fixed there by letting the server declare the scale — DatasetMeasureSchema has no such key, so the fix did not reach measures.
An on-time rate of 1.0 is not an edge case: it is the number a small tenant sees most often, and the one a customer is proudest of. Reporting it as 1% is the worst available failure.
What would close it
A dataset measure needs to say that its value is a fraction — the same thing percentScale: 'fraction' says for a field. Then format: '0%' on a derived ratio would be safe and this app would show 94% / 100% instead of 0.94 / 1.00.
Two halves, and they live upstream:
@objectstack/spec — DatasetMeasureSchema gains the annotation (it is z.strictObject, so an app cannot pass one through today).objectui — formatMeasure already prefers a declared scale over the heuristic; it just needs the measure's.
Filed here rather than upstream because I could not verify which upstream repo owns the pair from this checkout. Worth re-filing as objectstack-ai/objectstack + objectstack-ai/objectui when someone can.
Not blocking
duly_duty_health reads 0.94 today under a tile titled "On-time rate", with the denominator stated in its description. Unambiguous, and never a wrong number — just not the 94% it should be.
Found while adding
duly_duty_health.on_time_ratein #52. The rate ships as a bare fraction (format: '0.00'→0.94) because every percent spelling is either inert or wrong at the one value that matters most.Measured, in the browser, against the demo's 0.94
format0.94'percent'1'0.00'0.94— what ships'percent'is the obvious spelling and it is silently wrong. The console treatsformatas a numeral pattern, not a keyword (@object-ui/core,utils/dataset-format.ts#formatMeasure): decimals come fromformat.split('.')[1]?.match(/0/g)?.length ?? 0, and percent mode turns on only for a literal%. So'percent'means "zero decimals, not a percent", and 0.94 rounds to 1.Why
'0.0%'is not the answer eitherPercent mode scales by a heuristic, because a measure — unlike a field — has no declared
percentScaleto hand:A ratio of exactly 1 is outside that window, so a 100%-on-time period renders as
1.0%. The function's own docblock records the same defect for fields (objectui#3136), which was fixed there by letting the server declare the scale —DatasetMeasureSchemahas no such key, so the fix did not reach measures.An on-time rate of 1.0 is not an edge case: it is the number a small tenant sees most often, and the one a customer is proudest of. Reporting it as
1%is the worst available failure.What would close it
A dataset measure needs to say that its value is a fraction — the same thing
percentScale: 'fraction'says for a field. Thenformat: '0%'on a derived ratio would be safe and this app would show94%/100%instead of0.94/1.00.Two halves, and they live upstream:
@objectstack/spec—DatasetMeasureSchemagains the annotation (it isz.strictObject, so an app cannot pass one through today).objectui—formatMeasurealready prefers a declared scale over the heuristic; it just needs the measure's.Filed here rather than upstream because I could not verify which upstream repo owns the pair from this checkout. Worth re-filing as
objectstack-ai/objectstack+objectstack-ai/objectuiwhen someone can.Not blocking
duly_duty_healthreads0.94today under a tile titled "On-time rate", with the denominator stated in its description. Unambiguous, and never a wrong number — just not the94%it should be.