Skip to content

Conversation

@J0onYEong
Copy link
Collaborator

변경된 점

  • 가격표현 방식 수정

가격표현 방식 수정

기존의 표현의 경우 Fraction자리수의 최대 최소를 지정하고, 자리수 0부터 최대 자리수까지 순회하면서 가장 첫번째로 유효한 값이 등장하면 즉시 순회를 뭠추는 방법을 선택했습니다.

해당 방식의 경우 소수점에 0만 등장하는 경우 1.000000 과 같이 무의미한 표현을 증가시켰고, 1.20323과 같은 값을 1.2로 변경해버려 정보 훼손이 다소 심하게 발생했습니다.

따라서 문자열의 길이를 지정하고 그에 따라 동적으로 소수점 및 unit을 통한 표현 방식을 적용하도록 수정했습니다.

현재 희망하는 문자열 길이를 10으로 설정했습니다.

변경 전(소수점 표현 부족) 변경 후
변경 전(0반복) 변경 후

@J0onYEong J0onYEong requested a review from Copilot May 15, 2025 06:40
Copy link
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 updates the pricing display logic by replacing the previous adaptive fraction formatting with a new dynamic size-based formatting approach. Key changes include:

  • Adding new tests to verify the dynamic adaptive size output.
  • Replacing the adaptiveFractionFormat method with the adaptiveToSize method in CVNumber.
  • Updating dependent modules (e.g., CoinDetailPageViewModel) to call the new adaptiveToSize method with a fixed string length of 10.

Reviewed Changes

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

File Description
Projects/Utils/CoreUtil/Tests/CVNumberTests.swift Added tests for length-based compaction and K/M/B abbreviation checks
Projects/Utils/CoreUtil/Sources/DataStructure/CVNumber.swift Introduced a new adaptiveToSize method for dynamic pricing display, replacing the previous fraction-based approach
Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift Updated price text generation to use the new method for consistent pricing display

@J0onYEong J0onYEong merged commit 81d4040 into main May 15, 2025
1 of 2 checks passed
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