Skip to content

fix: honor explicit percentage representation - #157

Closed
ADITYA (adity982) wants to merge 4 commits into
microsoft:devfrom
adity982:fix/154-explicit-percent-scale
Closed

ADITYA (adity982) wants to merge 4 commits into
microsoft:devfrom
adity982:fix/154-explicit-percent-scale

Conversation

@adity982

Copy link
Copy Markdown

Summary

  • add an explicit percentScale semantic annotation for fraction versus percent-point storage
  • make percentage formatting prefer the annotation and keep data-based detection as the fallback
  • cover explicit fraction, explicit percent-point, and legacy detection behavior

Fixes #154

Validation

  • npm test --workspace packages/flint-js -- --run tests/percentage-format.test.ts (3 passed)
  • npm run lint --workspace packages/flint-js (passed with 49 pre-existing warnings)
  • npm run typecheck --workspace packages/flint-js could not complete in the sparse checkout because optional peer packages such as chart.js, echarts, vega, and d3-format are not installed; no changed-file diagnostics were reported before those missing-module errors

AI assistance

Codex helped implement and validate this focused change. The diff and regression behavior were reviewed against the issue reproduction.

@Chenglong-MS
Chenglong Wang (Chenglong-MS) changed the base branch from main to dev October 29, 2026 18:29
@Chenglong-MS

Copy link
Copy Markdown
Contributor

Thanks ADITYA (@adity982), and nice timing: dev already landed this fix for #154 with the same percentScale: 'fraction' | 'percent' annotation. It also reads a decisive intrinsicDomain (within ±1 means fractions, reaching 100 means percent points), works without a domain, and applies to value domains and KPI cards as well as formats. I ran your three tests against dev and they pass, so the behaviour you specified is covered. Closing as superseded; it ships in the next release. Thanks for the clear write-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Percentage representation is guessed from the data even when intrinsicDomain is set

3 participants