fix: format hour display on Loop End screen to avoid floating-point precision errors
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
- Use formatHour() instead of raw {hour} to display time in HH:MM format
(e.g. '15:00' instead of '14.999999999999998')
- Export formatHour from stores barrel index
- Fixes #336
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { fmt } from '@/lib/game/stores';
|
||||
import { fmt, formatHour } from '@/lib/game/stores';
|
||||
import { useGameStore } from '@/lib/game/stores';
|
||||
|
||||
interface GameOverScreenProps {
|
||||
@@ -40,7 +40,7 @@ export function GameOverScreen({ day, hour, insightGained, totalInsight }: GameO
|
||||
<div className="text-xs text-gray-400">Day Reached</div>
|
||||
</div>
|
||||
<div className="p-3 bg-gray-800 rounded">
|
||||
<div className="text-xl font-bold text-purple-400 game-mono">{hour}</div>
|
||||
<div className="text-xl font-bold text-purple-400 game-mono">{formatHour(hour)}</div>
|
||||
<div className="text-xs text-gray-400">Hour</div>
|
||||
</div>
|
||||
<div className="p-3 bg-gray-800 rounded">
|
||||
|
||||
@@ -32,6 +32,7 @@ export type { GameCoordinatorStore } from './gameStore';
|
||||
export {
|
||||
fmt,
|
||||
fmtDec,
|
||||
formatHour,
|
||||
getFloorMaxHP,
|
||||
getFloorElement,
|
||||
getFloorElements,
|
||||
|
||||
Reference in New Issue
Block a user