Conversation
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된 점
가격표현 방식 수정
기존의 표현의 경우 Fraction자리수의 최대 최소를 지정하고, 자리수 0부터 최대 자리수까지 순회하면서 가장 첫번째로 유효한 값이 등장하면 즉시 순회를 뭠추는 방법을 선택했습니다.
해당 방식의 경우 소수점에 0만 등장하는 경우 1.000000 과 같이 무의미한 표현을 증가시켰고, 1.20323과 같은 값을 1.2로 변경해버려 정보 훼손이 다소 심하게 발생했습니다.
따라서 문자열의 길이를 지정하고 그에 따라 동적으로 소수점 및 unit을 통한 표현 방식을 적용하도록 수정했습니다.
현재 희망하는 문자열 길이를 10으로 설정했습니다.