Add saleCostDisplay to PaidDomainSuggestion#1287
Closed
Conversation
Collaborator
XCFramework BuildThis PR's XCFramework is available for testing. Add to your .package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1287")Built from 754ce82 |
Adds formatting that matches the server's combined_sale_cost_display: currency prefix from cost field, comma thousand-separators, and two decimal places only for fractional values. Exposed as a method on PaidDomainSuggestion (for Rust callers), a free-standing UniFFI function (for cross-language export), and a Kotlin extension property on PaidDomainSuggestion. Test cases derived from real /products/?type=domains responses to ensure the formatting matches the server exactly.
568579a to
754ce82
Compare
Contributor
Author
|
We decided to keep the current logic and make a request to |
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.
Adds formatting that matches the server's
combined_sale_cost_display: currency prefix from cost field, comma thousand-separators, and two decimal places only for fractional values.Exposed as a method on
PaidDomainSuggestion(for Rust callers), a free-standing UniFFI function (for cross-language export), and a Kotlin extension property onPaidDomainSuggestion.Test cases derived from real
/products/?type=domainsresponses to ensure the formatting matches the server exactly.@jkmassel WPAndroid currently shows this value from the products endpoint, which we can implement. (may even need to for other screens) However, we also have the necessary components from the suggestions endpoint to construct it ourselves, saving an extra endpoint call. I figured I'd open the PR so you see it in action instead of pinging you and explaining it. So, the short story is that I am not sure if we really want to go about it this way.