Percentages and rates
Conversion funnels, utilization dashboards, margins, and return tables all use percentages, but their storage conventions can differ. Choose the raw representation before adding a formatter. These examples use the plugin registration from Number setup.
1. Format a ratio as a percentage
Section titled “1. Format a ratio as a percentage”The percent preset expects a ratio: 1 means 100%, and 0.125 means 12.5%.
grid.columns = [{ prop: 'rate', name: 'Conversion rate', dataGridFormat: { value: { kind: 'preset', preset: 'percent', locale: 'en-US', decimalPlaces: 1, } },}];grid.source = [{ rate: 0.125 }, { rate: 1 }, { rate: -0.025 }];The cells display 12.5%, 100.0%, and -2.5%. The percent scaling is part of international number formatting; it does not change the raw source.
| Raw value | Display with one decimal | Meaning |
|---|---|---|
0.125 | 12.5% | Ratio stored correctly |
12.5 | 1,250.0% | Already multiplied by 100 |
0 | 0.0% | Observed zero |
null | empty | Missing or unavailable |
If your API sends 12.5 for 12.5%, normalize it once to 0.125 before populating the ratio column. Do not divide only in a display template while leaving calculations to assume the other convention.
2. Distinguish rate, change, and difference
Section titled “2. Distinguish rate, change, and difference”Moving from 20% to 25% is a 5 percentage point increase and a 25% relative increase. Label them separately:
grid.columns = [ { prop: 'relativeChange', name: 'Relative change', dataGridFormat: { value: { kind: 'preset', preset: 'percent', locale: 'en-US', decimalPlaces: 1, } }, }, { prop: 'pointChange', name: 'Change (pp)', dataGridFormat: { value: { kind: 'preset', preset: 'number', locale: 'en-US', decimalPlaces: 1, } }, },];grid.source = [{ relativeChange: 0.25, pointChange: 5 }];For rates quoted in basis points, store and label the unit explicitly: 25 bps means 0.25 percentage points, or a ratio of 0.0025. Use a plain number column named Change (bps) when the raw value is already basis points. There is no separate basis-point preset.
3. Choose aggregation and editing rules
Section titled “3. Choose aggregation and editing rules”- For BI conversion totals, calculate
total conversions / total visits; averaging row percentages weights every row equally regardless of traffic. - Relative growth requires a defined policy when the prior value is zero or missing. Keep an unavailable result as
nullrather than displaying an invented 0%. - A ratio can exceed 1 or be negative in some metrics. Enforce
0..1only when the domain requires that range, such as a completion fraction. - Precision can hide small changes:
0.0004displays0.0%at one decimal. IncreasedecimalPlacesor use a basis-point column when the distinction matters. - The numeric editor edits the raw ratio. A displayed
12.5%does not automatically make the editor accept12.5as0.125. Document the input unit or provide an application-owned percent input adapter.
Change locale for localized percent placement and spacing; keep raw ratios identical across countries. See locale formats and currency and accounting for the companion money columns.