feat: v1 prototype — core game systems #30

Merged
naomi merged 84 commits from feat/prototype into main 2026-03-08 15:53:39 -07:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit b82a2d3da7 - Show all commits
+3 -1
View File
@@ -73,7 +73,9 @@ const formatSuffix = (value: number): string => {
return `${(value / threshold).toFixed(2)}${suffix}`;
}
}
return value.toFixed(1);
return value < 1
? value.toFixed(2)
: value.toFixed(1);
};
/**
+6 -2
View File
@@ -28,8 +28,12 @@ describe("formatNumber", () => {
expect(formatNumber(-1000)).toBe("-1.00K");
});
it("should format zero as '0.0'", () => {
expect(formatNumber(0)).toBe("0.0");
it("should format zero as '0.00'", () => {
expect(formatNumber(0)).toBe("0.00");
});
it("should format small decimal values with two decimal places", () => {
expect(formatNumber(0.01)).toBe("0.01");
});
});