Bug description
The Cube Playground does not multiply values by 100 when displaying measures/dimensions with format: percent. Per the official documentation:
When using the percent format, do not multiply by 100 in your SQL expression. Presentation tools like Explore, Workbooks, and Dashboards apply this multiplication implicitly when displaying percent-formatted values, e.g., a value of 0.5 will be displayed as 50%.
However, the Playground simply appends % to the raw API value without multiplying by 100. A value of 0.273 (representing 27.3%) is displayed as 0.273% instead of 27.3%.
Affected code
The bug exists in three separate rendering paths:
1. QueryBuilderResults.tsx (~line 788)
case 'percent':
return [
`${formatNumber(typeof value === 'string' ? parseFloat(value) : value)}%`,
'percent',
];
2. DrilldownModal/TableQueryRenderer.tsx (~line 38)
if (type === 'number' && format === 'percent') {
return [parseFloat(value).toFixed(2), '%'].join('');
}
3. ChartRenderer.tsx (table chart, ~line 437)
No percent-specific handling at all — raw value is displayed as-is.
Expected behavior
All three paths should multiply the value by 100 before appending %, consistent with the documentation. For example:
case 'percent':
return [
`${formatNumber((typeof value === 'string' ? parseFloat(value) : value) * 100)}%`,
'percent',
];
Steps to reproduce
- Create a cube with a
format: percent measure (e.g., a ratio like 1.0 * {purchases} / {count})
- Query it in the Playground
- Observe that the value is displayed as e.g.
0.273% instead of 27.3%
Version
Observed on v1.6.30 but appears to be a long-standing issue based on the code.
Bug description
The Cube Playground does not multiply values by 100 when displaying measures/dimensions with
format: percent. Per the official documentation:However, the Playground simply appends
%to the raw API value without multiplying by 100. A value of0.273(representing 27.3%) is displayed as0.273%instead of27.3%.Affected code
The bug exists in three separate rendering paths:
1. QueryBuilderResults.tsx (~line 788)
2. DrilldownModal/TableQueryRenderer.tsx (~line 38)
3. ChartRenderer.tsx (table chart, ~line 437)
No percent-specific handling at all — raw value is displayed as-is.
Expected behavior
All three paths should multiply the value by 100 before appending
%, consistent with the documentation. For example:Steps to reproduce
format: percentmeasure (e.g., a ratio like1.0 * {purchases} / {count})0.273%instead of27.3%Version
Observed on v1.6.30 but appears to be a long-standing issue based on the code.