diff --git a/README.md b/README.md
index b626d76bc1..1fe2a5bad8 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
[](https://github.com/Unleash/unleash/actions/workflows/build.yaml) [](https://github.com/Unleash/unleash/actions/workflows/build_coverage.yaml) [](https://hub.docker.com/r/unleashorg/unleash-server) [](https://github.com/Unleash/unleash/blob/main/LICENSE) [](https://slack.unleash.run)
-[Experience Unleash Live Demo →](https://www.getunleash.io/interactive-demo)
+[Try Unleash Cloud for free →](https://www.getunleash.io/plans/enterprise-payg?utm_source=readme&utm_medium=oss&utm_content=top-cta)
@@ -93,9 +93,9 @@ The above sections show you how to get up and running quickly and easily. When y
## Online demo
-Try out [the Unleash online demo](https://www.getunleash.io/interactive-demo).
+Try out [the Unleash online demo](https://www.getunleash.io/interactive-demo?utm_source=readme&utm_medium=oss&utm_content=demo-section-cta).
-[](https://www.getunleash.io/interactive-demo)
+[](https://www.getunleash.io/interactive-demo?utm_source=readme&utm_medium=oss&utm_content=demo-section-cta)
diff --git a/frontend/src/component/insights/calculate-ratio/calculate-ratio.test.ts b/frontend/src/component/insights/calculate-ratio/calculate-ratio.test.ts
index 61548cd669..39c92b95e5 100644
--- a/frontend/src/component/insights/calculate-ratio/calculate-ratio.test.ts
+++ b/frontend/src/component/insights/calculate-ratio/calculate-ratio.test.ts
@@ -1,17 +1,17 @@
import { calculateRatio } from './calculate-ratio.ts';
-test('A ratio of anything to 0 is 100', () => {
- expect(calculateRatio(0, 0)).toBe(100);
- expect(calculateRatio(5, 0)).toBe(100);
+test('A ratio of anything to 0 is N/A', () => {
+ expect(calculateRatio(0, 0)).toBe('N/A');
+ expect(calculateRatio(5, 0)).toBe('N/A');
});
test('Normal ratios work as expected', () => {
- expect(calculateRatio(0, 1)).toBe(0);
- expect(calculateRatio(1, 1)).toBe(100);
- expect(calculateRatio(1, 2)).toBe(50);
- expect(calculateRatio(5, 2)).toBe(250);
+ expect(calculateRatio(0, 1)).toBe('0%');
+ expect(calculateRatio(1, 1)).toBe('100%');
+ expect(calculateRatio(1, 2)).toBe('50%');
+ expect(calculateRatio(5, 2)).toBe('250%');
});
test('Numbers are rounded to the nearest integer', () => {
- expect(calculateRatio(5, 9)).toBe(56);
+ expect(calculateRatio(5, 9)).toBe('56%');
});
diff --git a/frontend/src/component/insights/calculate-ratio/calculate-ratio.ts b/frontend/src/component/insights/calculate-ratio/calculate-ratio.ts
index ad5e1066a6..b80875bf84 100644
--- a/frontend/src/component/insights/calculate-ratio/calculate-ratio.ts
+++ b/frontend/src/component/insights/calculate-ratio/calculate-ratio.ts
@@ -1,12 +1,11 @@
export const calculateRatio = (
antecedent: number,
consequent: number,
-): number => {
- const rawRatio = Math.round((antecedent / consequent) * 100);
-
- if (Number.isNaN(rawRatio) || rawRatio === Number.POSITIVE_INFINITY) {
- return 100;
+): string => {
+ if (consequent === 0) {
+ return 'N/A';
}
+ const ratio = Math.round((antecedent / consequent) * 100);
- return rawRatio;
+ return `${ratio}%`;
};
diff --git a/frontend/src/component/insights/componentsChart/CreationArchiveChart/CreationArchiveRatioTooltip.tsx b/frontend/src/component/insights/componentsChart/CreationArchiveChart/CreationArchiveRatioTooltip.tsx
index d0cec6f585..3a33da08e7 100644
--- a/frontend/src/component/insights/componentsChart/CreationArchiveChart/CreationArchiveRatioTooltip.tsx
+++ b/frontend/src/component/insights/componentsChart/CreationArchiveChart/CreationArchiveRatioTooltip.tsx
@@ -65,7 +65,7 @@ export const CreationArchiveRatioTooltip: FC<
- Ratio {ratio}%
+ Ratio {ratio}