Skip to content

fix: resolve usdPerDay mismatch between miner list and detail APIs#1242

Open
Kelvinchen03 wants to merge 1 commit into
entrius:testfrom
Kelvinchen03:fix/usd-per-day-inconsistent-between-apis
Open

fix: resolve usdPerDay mismatch between miner list and detail APIs#1242
Kelvinchen03 wants to merge 1 commit into
entrius:testfrom
Kelvinchen03:fix/usd-per-day-inconsistent-between-apis

Conversation

@Kelvinchen03
Copy link
Copy Markdown

Summary

Fixed inconsistent usdPerDay display values between the leaderboard (/repositories) and miner details (/miners/details) pages. The issue was caused by different API responses returning slightly different values (e.g., 123.60 vs 123.08), which when rounded with Math.round() resulted in different displayed values ($124 vs $123).

Solution: Centralized USD/day formatting logic by creating a shared formatUsdPerDay() utility function that uses consistent rounding behavior (.toFixed(0)) across all components.

Related Issues

Fixes #1241

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Different responses for usdPerDay values from miners APIs

1 participant