Skip to content

refactor: replace formatPrice with formatNumber#4

Open
ymcbzrgn wants to merge 4 commits into
mainfrom
jules-3511230033843476217-33beef13
Open

refactor: replace formatPrice with formatNumber#4
ymcbzrgn wants to merge 4 commits into
mainfrom
jules-3511230033843476217-33beef13

Conversation

@ymcbzrgn
Copy link
Copy Markdown
Owner

Replace formatPrice compatibility wrapper function call usage or implementation with formatNumber.

  • Found formatPrice usage in src/utils/formatters/numberformat.ts and many places around the codebase.
  • Replaced the function formatPrice with formatNumber everywhere in the codebase.
  • Removed the formatPrice implementation from src/utils/formatters/numberformat.ts.
  • Edited src/components/ai/TradeReasoning.vue to add the missing value properties to the <TabPanel> elements to resolve the TypeScript errors.
  • Ran pnpm typecheck and pnpm test:unit to ensure everything works properly.

PR created automatically by Jules for task 3511230033843476217 started by @ymcbzrgn

@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings May 11, 2026 09:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the frontend formatting utilities by removing the formatPrice compatibility wrapper and standardizing on formatNumber, with follow-up updates to UI usage and generated type declarations. It also addresses PrimeVue tab typing issues in the AI trade reasoning view.

Changes:

  • Removed formatPrice from the number formatter module and replaced call sites with formatNumber.
  • Updated UI components and utilities to use formatNumber consistently (while retaining formatPriceCurrency).
  • Updated generated typing files and added missing value props to <TabPanel> entries to resolve TypeScript errors.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frequi/src/utils/formatters/numberformat.ts Removes the formatPrice wrapper and routes currency formatting through formatNumber.
frequi/src/utils/backtestMetrics.ts Switches stake formatting from formatPrice to formatNumber.
frequi/src/components/general/ProfitPill.vue Updates profit display formatting to use formatNumber.
frequi/src/components/ftbot/TradeList.vue Updates trade list numeric formatting to use formatNumber.
frequi/src/components/ftbot/TradeDetail.vue Updates trade detail numeric formatting to use formatNumber.
frequi/src/components/ftbot/PeriodBreakdown.vue Replaces formatting calls with formatNumber in period breakdown table.
frequi/src/components/ftbot/CustomTradeListEntry.vue Updates trade entry formatting to use formatNumber.
frequi/src/components/ftbot/BotPerformance.vue Updates performance table formatter to use formatNumber.
frequi/src/components/ftbot/BotComparisonList.vue Updates balance formatting to use formatNumber.
frequi/src/components/ftbot/BotBalance.vue Updates balance formatting helper to use formatNumber.
frequi/src/components/ftbot/BacktestResultTablePer.vue Replaces backtest result number formatting with formatNumber.
frequi/src/components/ftbot/BacktestResultPeriodBreakdown.vue Updates period breakdown formatting to use formatNumber.
frequi/src/components/charts/CumProfitChart.vue Updates tooltip profit formatting to use formatNumber.
frequi/src/components/ai/TradeReasoning.vue Adds missing value props to TabPanel elements to satisfy TS typing.
frequi/src/components.d.ts Updates generated global component typings (new AI components included).
frequi/src/auto-imports.d.ts Removes formatPrice from Vue component custom properties typings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 24 to 29
function useFormatPriceStake(stake_currency_decimals: number, stake_currency: string) {
const formatPriceStake = (price) => {
return `${formatPrice(price, stake_currency_decimals)} ${stake_currency}`;
return `${formatNumber(price, stake_currency_decimals)} ${stake_currency}`;
};
return formatPriceStake;
}
const confirmExitValue = ref<ModalReasons | null>(null);

const increasePosition = ref({ visible: false, trade: {} as Trade });
function formatPriceWithDecimals(price: number) {
Comment on lines 21 to 26
} else if (props.profitAbs !== undefined) {
if (props.stakeCurrency !== undefined) {
return `${formatPriceCurrency(props.profitAbs, props.stakeCurrency, 3)}`;
} else {
return `${formatPrice(props.profitAbs, 3)}`;
return `${formatNumber(props.profitAbs, 3)}`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants