feat: update price display use current currency symbol - #2360
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
web/src/helpers/render.jsx (1)
1089-1094: Currency conversion/symbol integration looks correct; you can avoid an extra config lookupUsing
getCurrencyConfig()here and applyingmodelPrice * rateis consistent with the other pricing helpers and achieves the PR goal of honoring the configured currency. Since the currency data is only needed whenmodelPrice !== -1, you can optionally move the call into that branch to skip alocalStorageread + JSON parse on the pure-ratio path.- const { symbol, rate } = getCurrencyConfig(); - if (modelPrice !== -1) { - const displayPrice = (modelPrice * rate).toFixed(6); - return i18next.t('价格:{{symbol}}{{price}} * {{ratioType}}:{{ratio}}', { - symbol: symbol, - price: displayPrice, + if (modelPrice !== -1) { + const { symbol, rate } = getCurrencyConfig(); + const displayPrice = (modelPrice * rate).toFixed(6); + return i18next.t('价格:{{symbol}}{{price}} * {{ratioType}}:{{ratio}}', { + symbol, + price: displayPrice, ratioType: ratioLabel, ratio: finalGroupRatio, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/src/helpers/render.jsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
web/src/helpers/render.jsx (2)
web/src/hooks/model-pricing/useModelPricingData.jsx (1)
displayPrice(174-186)web/src/helpers/utils.jsx (1)
symbol(649-649)
使用日志详情的货币单位使用设置的单位

比如当前设置为人民币
之前:
修复后:

Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.