Skip to content

fix(mining-simulator): use consistent 6-decimal precision in comparison table (#7730)#7782

Merged
Scottcjn merged 2 commits into
Scottcjn:mainfrom
lequangsang01:fix/7730-simulator-precision
Jul 1, 2026
Merged

fix(mining-simulator): use consistent 6-decimal precision in comparison table (#7730)#7782
Scottcjn merged 2 commits into
Scottcjn:mainfrom
lequangsang01:fix/7730-simulator-precision

Conversation

@lequangsang01

Copy link
Copy Markdown
Contributor

Closes #7730

RTC wallet: RTCfe13452d122263caf633ab1876bd9631133b68b1

Changes

  • Changed comparison table precision from toFixed(2) to toFixed(6) to match main reward display
  • Fixed VM reward display showing 0.00 RTC instead of 0.000001 RTC
  • Ensures consistent precision across all reward displays

Testing

  • Verified VM reward now displays correctly as 0.000001 RTC
  • No code changes that require automated tests

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/XS PR: 1-10 lines labels Jun 30, 2026

@FakerHideInBush FakerHideInBush left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR makes the identical change as open PR #7769 (fix: use toFixed(6) for VM reward precision in comparison table (#7730)) — both change the same line in mining-simulator.html:

-                    <div class="earnings">${(baseReward * c.multiplier).toFixed(2)} RTC</div>
+                    <div class="earnings">${(baseReward * c.multiplier).toFixed(6)} RTC</div>

Additionally, the open PR #7764 ([codex] Show VM mining rewards with six decimals) also changes mining-simulator.html with a .toFixed(6) update. There are now at least three PRs touching the same file for the same class of fix — only one can merge without conflicts.

All three of these PRs (#7764, #7769, #7782) also share the underlying problem that .toFixed(6) always emits trailing zeros (e.g. 1.500000 RTC), which is visually cluttered for normal-sized rewards. This concern was raised in the review of #7764. Please consolidate these PRs and use a conditional formatter that shows precision only when values are small enough to need it.

@lequangsang01
lequangsang01 force-pushed the fix/7730-simulator-precision branch from 95b3322 to 8177cb6 Compare June 30, 2026 05:04
@github-actions github-actions Bot added BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related api API endpoint related tests Test suite changes size/S PR: 11-50 lines and removed size/XS PR: 1-10 lines labels Jun 30, 2026

@jaxint jaxint left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR fixes mining simulator precision.

Changes:

  • Uses consistent 6-decimal precision in comparison table
  • Ensures accurate reward calculations

Quality:

  • Consistent formatting
  • Matches expected precision

APPROVED

@Scottcjn
Scottcjn merged commit aac9291 into Scottcjn:main Jul 1, 2026
11 checks passed
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

RTC Reward

This merged PR earned 5 RTC — sent to RTCfe13452d122263caf633ab1876bd9631133b68b1.

RustChain Bounty Program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API endpoint related BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Mining Simulator comparison table hides VM reward due to insufficient precision

4 participants